Computer science · Class 12 · virtual lab
Python exceptions: try, except, else, finally
Goal: See which blocks of a try statement run for good input, handled errors and unhandled errors.
Six steps: predict, try, observe, record, explain and check. The Record step adds a row to your observation table, and the Check step scores your quick quiz.
Loading the lab…
What this lab simplifies
- Only three simple statements are used.
- Only ValueError, ZeroDivisionError, IndexError and Exception are used.
- Real programs can nest try blocks and raise their own errors; this lab does not.