Naar hoofdinhoud
🔒 Voorbeeldmodus. De eerste vijftien Foundations-lessen zijn gratis; deze is Pro. Start een 7-daagse trial om de editor, AI-hints en de rest van het curriculum te ontgrendelen. Kaart vereist, op elk moment opzegbaar in Dashboard.Start 7-daagse trial →
← CursussenPython FoundationsModule 9 · Bonus: mini-projectsMINI: Calculator with history (last N results)mission173 / 174
+200 XP
Opdracht🌐 shown in RU
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)]
✏️ Schrijf hier je code
🐍
Python laden...
Eenmalige download (~1 MB). Daarna direct beschikbaar.
📊 Resultaat
Klik op Uitvoeren om het resultaat te zien...

💬 Discussie

Wees de eerste — stel een vraag of deel een tip.
Log in om mee te doen aan de discussie. Lezen is gratis.
Discussie laden…