Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a dictionary #1053

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
23 changes: 21 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Gudei marked this conversation as resolved.
Show resolved Hide resolved
Loading