From 247e96297f8892780e0a851ace6a2617a5f7d06f Mon Sep 17 00:00:00 2001 From: Illya Huda Date: Mon, 13 Nov 2023 17:41:21 +0200 Subject: [PATCH] Creating a dictionary --- app/main.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index f07695b9..2802a72f 100644 --- a/app/main.py +++ b/app/main.py @@ -15,5 +15,24 @@ "Sergio": 3, } collection_of_coins = {1, 2, 25} - -# write your code here +# write code below this line +list_of_all_variable = [ + lucky_number, + pi, + one_is_a_prime_number, + name, + my_favourite_films, + profile_info, + marks, + collection_of_coins +] +sorted_variables = {} +mutable_variable_list = [] +immutable_variable_list = [] +for element in list_of_all_variable: + if isinstance(element, (int, str, bool, float, tuple)): + immutable_variable_list.append(element) + else: + mutable_variable_list.append(element) +sorted_variables["mutable"] = mutable_variable_list +sorted_variables["immutable"] = immutable_variable_list