Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

def ismutable(var_name) -> bool:

if isinstance(var_name, int | float | str | bool | tuple):
return False
return True


lucky_number = 777
pi = 3.14
one_is_a_prime_number = False
Expand All @@ -15,5 +23,16 @@
"Sergio": 3,
}
collection_of_coins = {1, 2, 25}
sorted_variables = {
"mutable": [],
"immutable": []
}

variables_list = [lucky_number, pi, one_is_a_prime_number, name,
my_favourite_films, profile_info, marks, collection_of_coins]

# write your code here
for variable in variables_list:
if ismutable(variable):
sorted_variables["mutable"].append(variable)
else:
sorted_variables["immutable"].append(variable)
Loading