From 47525bb41c2b703bdc58e7e8c5eae76d345eaf75 Mon Sep 17 00:00:00 2001 From: Nader Idkeidek Date: Thu, 21 May 2026 13:57:33 +0300 Subject: [PATCH] Add sorting of variables by type 8 --- app/main.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index f07695b9b..d93ab8e7e 100644 --- a/app/main.py +++ b/app/main.py @@ -16,4 +16,20 @@ } collection_of_coins = {1, 2, 25} -# write your code here +# Create dictionary +sorted_variables = { + "mutable": [], + "immutable": [] +} + +# Put variables into a list +variables = [lucky_number, pi, one_is_a_prime_number, name, my_favourite_films, profile_info, marks, collection_of_coins] + +# Check each variable type +for variable in variables: + if type(variable) in [list, dict, set,tuple]: + sorted_variables["mutable"].append(variable) + else: + sorted_variables["immutable"].append(variable) + +print(sorted_variables)