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 #2058

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #2058

wants to merge 1 commit into from

Conversation

kbatrakov
Copy link

No description provided.

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 task! 🎉 Your code correctly categorizes variables into mutable and immutable types and meets the task requirements. There's a minor suggestion to improve your logic: consider using isinstance(value, (list, dict, set)) to check for mutable types, as it provides a more accurate check for lists, dictionaries, and sets. Keep up the good work and happy coding! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


for value in variables.values():
check = type(value)
if check in mutable:

Choose a reason for hiding this comment

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

The logic here checks if the type of the variable is in the list of mutable types. However, this will not work for lists, dictionaries, and sets because type(value) returns <class 'list'>, <class 'dict'>, or <class 'set'>, which are not directly comparable to list, dict, or set. Consider using isinstance(value, (list, dict, set)) to check for mutable types.

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.

2 participants