Skip to content

Language

Sign in

← Back to the lesson

🔬 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.

  1. Predict
  2. Try
  3. Observe
  4. Record
  5. Explain
  6. Check

Loading the lab…

About this lab

Behind the experiment.

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.

No screen? Use paper.

The activity sheet has the same steps, a results table and the questions, ready to print.

Printable activity sheet (paper version)All labs

Python exceptions: try, except, else, finally: virtual lab · EduFlint