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

implement py-mutable-immutable #2209

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

Conversation

IhorVerba
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 organizing the variables into mutable and immutable categories! 🎉 Your solution meets the task requirements and constraints effectively. The categorization of most variables is spot-on, and your implementation aligns well with the task description.

However, there's a minor point to consider regarding the collection_of_coins variable. While sets in Python allow for modification of their elements (adding or removing), they are not hashable and cannot be used as dictionary keys, which is a typical trait of immutable objects. This might slightly affect the categorization if your definition of 'mutable' and 'immutable' is based on hashability.

Overall, your code works as expected, and this is just a small point for future consideration. Keep up the great work! 🚀

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

Comment on lines +19 to +22
sorted_variables = {
"mutable": [my_favourite_films, marks, collection_of_coins],
"immutable": [lucky_number, pi, one_is_a_prime_number, name, profile_info]
}

Choose a reason for hiding this comment

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

The collection_of_coins variable is categorized as mutable, but sets in Python are mutable only in terms of their elements being changeable (i.e., you can add or remove elements). However, the set itself is not hashable and cannot be used as a key in a dictionary, which is a typical characteristic of immutable objects. Consider whether this categorization aligns with your intended use of 'mutable' and 'immutable'.

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