Solve mutable and immutable task - #3834
silvacarvalho17 wants to merge 3 commits into
Conversation
Solve mutable and immutable task
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
This requires changes because the current code triggers critical, blocking errors that prevent task completion. In app/main.py, flake8 reports undefined names for all eight variables referenced in sorted_variables (lines 3–12), which means the dictionary points to variables that are not defined, causing F821 errors and failing the pipeline. The requirement is to include eight variables of different types and group them under the correct mutable and immutable lists; without defining these variables, functionality is broken and tests will fail.
Critical issues to fix:
- Define the eight variables in
app/main.pywith appropriate types and values so they exist whensorted_variablesreferences them:- Immutable examples:
lucky_number(int),pi(float),one_is_a_prime_number(bool),name(str) - Mutable examples:
my_favourite_films(list),marks(list or set as required),collection_of_coins(set),profile_info(tuple if you intend it immutable, or dict if intended mutable—ensure the grouping matches the type)
- Immutable examples:
- Ensure each variable’s mutability matches its placement in
sorted_variables. - Remove the trailing blank line at the end of the file to address W391.
Minor improvement:
- After defining the variables, re-run flake8 locally to confirm no lint errors remain.
Once these are addressed, your dictionary structure looks good, and you should be all set. Keep up the good work aligning types with mutability!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. You defined eight variables covering the required types (int, float, bool, str, list, tuple, dict, set) and correctly grouped them by mutability in the sorted_variables dictionary under mutable and immutable. This matches the task’s core requirements and ensures clarity between mutable (list, dict, set) and immutable (int, float, bool, str, tuple) types. Functionality appears correct and complete, with no blockers. As a minor polish, ensure there’s no trailing blank line to satisfy common linters like flake8 (W391), but this is not required for passing. Nicely done and well structured.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.