-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 #1985
base: master
Are you sure you want to change the base?
Solution #1985
Conversation
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.
Your solution is on the right track, but there are a few critical issues that need to be addressed before it can be approved. The function types_variables
currently only checks for tuples and lists, missing other important types like dictionaries, sets, integers, floats, and strings. The task requires creating a dictionary sorted_variables
with keys "mutable"
and "immutable"
, which is not yet implemented. Please expand your logic to include these types and ensure all variables are correctly categorized. Keep up the good work, and I'm confident you'll get it right with a few adjustments! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
app/main.py
Outdated
for variable in variables: | ||
if isinstance(variable, tuple): | ||
if all(not isinstance(el, list) for el in variable): | ||
sorted_variables["immutable"].append(variable) | ||
else: | ||
sorted_variables["mutable"].append(variable) | ||
elif isinstance(variable, list): | ||
sorted_variables["mutable"].append(variable) | ||
|
||
return sorted_variables |
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.
The current implementation only checks for tuples and lists. It misses other mutable types like dictionaries and sets, and immutable types like integers, floats, and strings. Consider adding checks for these types to categorize them correctly.
finally right version |
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.
Great job on implementing the sorted_variables
dictionary! 🎉 Your code in app/main.py
successfully categorizes variables into mutable
and immutable
types, aligning perfectly with the task requirements. This demonstrates a solid understanding of Python data types.
While there are no issues with your current implementation, always remember to review any comments for potential improvements. This will help you refine your skills and avoid similar issues in future tasks. Keep up the excellent work and continue learning from each experience! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
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.
Well done! 😄
post solution