-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Solution #1141
base: master
Are you sure you want to change the base?
Solution #1141
Conversation
app/main.py
Outdated
q1 = {"lucky_number": lucky_number, "lucky_number": lucky_number, | ||
"one_is_a_prime_number": one_is_a_prime_number, | ||
"name": name, "my_favourite_films": my_favourite_films, | ||
"profile_info": profile_info, "marks": marks, | ||
"collection_of_coins": collection_of_coins, | ||
"sorted_variables": sorted_variables} | ||
|
||
for i in q1: | ||
if type(q1[i]) == int or type(q1[i]) == str or type(q1[i]) == bool or type(q1[i]) == float or type(q1[i]) == tuple: | ||
sorted_variables["immutable"].append(i) | ||
else: | ||
sorted_variables["mutable"].append(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can explicitly create dictionary with defined keys and values. for loop is unnecessary for this specific task.
app/main.py
Outdated
@@ -1,5 +1,5 @@ | |||
lucky_number = 777 | |||
pi = 3.14 | |||
lucky_number = 3.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you rename this variable?
app/main.py
Outdated
a_ = my_favourite_films | ||
b_ = marks | ||
c_ = collection_of_coins | ||
d_ = lucky_number | ||
e_ = one_is_a_prime_number | ||
r_ = pi | ||
t_ = name | ||
y_ = profile_info | ||
sorted_variables = {"mutable": [a_, b_, c_], "immutable": [d_, e_, r_, t_, y_]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a_ = my_favourite_films | |
b_ = marks | |
c_ = collection_of_coins | |
d_ = lucky_number | |
e_ = one_is_a_prime_number | |
r_ = pi | |
t_ = name | |
y_ = profile_info | |
sorted_variables = {"mutable": [a_, b_, c_], "immutable": [d_, e_, r_, t_, y_]} | |
sorted_variables = { | |
"mutable": [my_favourite_films, marks, collection_of_coins], | |
"immutable": [lucky_number, pi, one_is_a_prime_number, name, profile_info] | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement changes requested by the previous mentor
app/main.py
Outdated
a_ = my_favourite_films | ||
b_ = marks | ||
c_ = collection_of_coins | ||
d_ = lucky_number | ||
e_ = one_is_a_prime_number | ||
r_ = pi | ||
t_ = name | ||
y_ = profile_info | ||
sorted_variables = {"mutable": [a_, b_, c_], "immutable": [d_, e_, r_, t_, y_]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
No description provided.