Skip to content
←
Builder · Coding
Build a calculator in Python
⏱ 4:21 elapsed
+30 XP
01
Hook
02
Explain
✏️
03
Practice
💬
04
Feedback
🪞
05
Reflect
🌱
06
Evolve
✏️ Step 3 · Practice
Drop each snippet into the right slot of divide(a, b)
You'll get instant feedback after each drop. 2 left.
🐍 divide(a, b) — Python function template
✓ 1 · Guard against b == 0
? Drop here
? Drop here
DRAG OR TAP A LABEL
🚨
raise ZeroDivisionError('b must be non-zero')
✅
return a / b
🪤
return None # silently swallow
Build a calculator in Python 🐍 · Lesson · LearnAI