Skip to main content
⚑
← Coursesβ€ΊCreative ChallengesModule 6 Β· πŸ”§ Refactor Master (10)β€ΊπŸ”§ Refactor #06: Mutating a global β†’ pure functionfix56 / 100
πŸ’¬ DiscussπŸ§ͺ Playground+125 XP
Task
πŸ“ **Task:** Refactor `add_sale` to be pure: accept `totals` as a parameter and return the updated dict. πŸ“‹ Implement the function above. Tests run automatically. πŸ’‘ **Hint:** Re-read the theory if stuck.

Keep going

✏️ Write your code here
🐍
Loading Python...
First visit only β€” ~5-10s. Stays cached afterward.
πŸ“Š Result
Press Run to see result...
πŸ“£ Help someone learn PythonShare this lesson with a friend β€” the first 15 are free, no signup.Tweet

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…