From 61a081bdbd88b6885135a3da266ac7b96c197229 Mon Sep 17 00:00:00 2001 From: DAVYD Date: Mon, 16 Dec 2024 20:57:10 -0500 Subject: [PATCH] Solution --- app/main.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index f07695b9..1b19c7bb 100644 --- a/app/main.py +++ b/app/main.py @@ -16,4 +16,35 @@ } collection_of_coins = {1, 2, 25} -# write your code here +sorted_variables = { + "mutable": [], + "immutable": [] +} + +variables = { + "lucky_number": lucky_number, + "pi": pi, + "one_is_a_prime_number": one_is_a_prime_number, + "name": name, + "profile_info": profile_info, + "my_favourite_films": my_favourite_films, + "marks": marks, + "collection_of_coins": collection_of_coins, +} + +mutable_types = (list, dict, set) + +for var_name, var_value in variables.items(): + if isinstance(var_value, mutable_types): + sorted_variables["mutable"].append(var_value) + else: + sorted_variables["immutable"].append(var_value) + +print("Sorted Variables Dictionary:") +print("Mutable Variables:") +for var in sorted_variables["mutable"]: + print(var) + +print("\nImmutable Variables:") +for var in sorted_variables["immutable"]: + print(var) \ No newline at end of file