Skip to content

Solve mutable and immutable task - #3834

Open
silvacarvalho17 wants to merge 3 commits into
mate-academy:masterfrom
silvacarvalho17:master
Open

silvacarvalho17 wants to merge 3 commits into
mate-academy:masterfrom
silvacarvalho17:master

Conversation

@silvacarvalho17

Copy link
Copy Markdown

No description provided.

Solve mutable and immutable task

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.py with appropriate types and values so they exist when sorted_variables references 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)
  • 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@silvacarvalho17 silvacarvalho17 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Solved

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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! ✨

Footnotes

  1. Rate AI review example

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