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
41 changes: 41 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,44 @@
collection_of_coins = {1, 2, 25}

# write your code here
lucky_number = 777
pi = 3.14
one_is_a_prime_number = False
name = "Richard"
my_favourite_films = [
"The Shawshank Redemption",
"The Lord of the Rings: The Return of the King",
"Pulp Fiction",
"The Good, the Bad and the Ugly",
"The Matrix",
]
profile_info = ("michel", "michel@gmail.com", "12345678")
marks = {
"John": 4,
"Sergio": 3,
}
collection_of_coins = {1, 2, 25}
Comment on lines +20 to +36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are already defined at the top of the file (lines 1-17). Declaring them a second time here is redundant and should be removed.


# write your code here

sorted_variables = {
"mutable": [],
"immutable": []
}

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

for var in variables:
if isinstance(var, (list, dict, set)):
sorted_variables["mutable"].append(var)
else:
sorted_variables["immutable"].append(var)
Loading