From 5023a14a1cb352a6c7f03865cf9ff5673601f3af Mon Sep 17 00:00:00 2001 From: Anderson Barcellos Dias Date: Wed, 11 Mar 2026 14:34:17 -0300 Subject: [PATCH] Solution --- app/main.py | 5 ++++- tests/test_main.py | 14 ++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/main.py b/app/main.py index f07695b9b..4d39e0963 100644 --- a/app/main.py +++ b/app/main.py @@ -16,4 +16,7 @@ } collection_of_coins = {1, 2, 25} -# write your code here +sorted_variables = { + "mutable": [my_favourite_films, marks, collection_of_coins], + "immutable": [lucky_number, pi, one_is_a_prime_number, name, profile_info], +} diff --git a/tests/test_main.py b/tests/test_main.py index a5cb4cbc0..12570f3de 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -68,8 +68,8 @@ def test_variables_values(variable, value): def test_variables_should_be_added_to_sorted_variables(variable_name): sorted_variables = getattr(app.main, "sorted_variables") assert ( - getattr(app.main, variable_name) in sorted_variables["mutable"] or - getattr(app.main, variable_name) in sorted_variables["immutable"] + getattr(app.main, variable_name) in sorted_variables["mutable"] + or getattr(app.main, variable_name) in sorted_variables["immutable"] ), f"Variable '{variable_name}' should be added to 'sorted_variables'" @@ -82,14 +82,12 @@ def is_immutable(obj): def test_variables_added_to_the_correct_list(): sorted_variables = getattr(app.main, "sorted_variables") for variable in sorted_variables["mutable"]: - assert is_immutable(variable) is False, ( - f"{variable} should be in 'immutable' list" - ) + assert ( + is_immutable(variable) is False + ), f"{variable} should be in 'immutable' list" for variable in sorted_variables["immutable"]: - assert is_immutable(variable) is True, ( - f"{variable} should be in 'mutable' list" - ) + assert is_immutable(variable) is True, f"{variable} should be in 'mutable' list" def test_removed_comment():