Handling errors
Lesson 18 of 20 · Py.Micro
try/except lets a program react to problems instead of crashing.
If the user types "abc", int() raises a ValueError and the program stops.
Do it in the browser: a real Python tool, a short mission and instant feedback. No install.
Start this lesson — free