Skip to main content
← CoursesPython FoundationsМодуль 9 · Бонус: міні-проєктиMINI: Calculator with history (last N results)mission169 / 170
💬 Discuss🧪 Playground+200 XP
Task
Build the `Calc` class. Evaluate 7 expressions in sequence and print the history list. Expressions: 2+3, 10*4, 100-1, 5**3, 7+7, 9*9, 100/4 After the loop, `print(list(calc.history))` should show only the last 5 (first two evicted): Expected: [('100-1', 99), ('5**3', 125), ('7+7', 14), ('9*9', 81), ('100/4', 25.0)]

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…