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

Solution #1985

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Solution #1985

wants to merge 6 commits into from

Conversation

yelizaveta-zh
Copy link

post solution

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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
Comment on lines 25 to 34
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

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.

@yelizaveta-zh
Copy link
Author

finally right version

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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! ✨

Copy link

@petrykivd petrykivd left a comment

Choose a reason for hiding this comment

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

Well done! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants