Python Quest

Track 9 · Lesson 2 of 11

Common exceptions and what they mean

Recognise ValueError, TypeError, KeyError, IndexError, AttributeError, ZeroDivisionError and NameError, and know where to look for each one's cause.

About 35 minBeginner4 exercises

You will be able to

  • Say what each of the seven most common built-in exceptions means in plain language
  • Tell ValueError from TypeError and KeyError from IndexError
  • Use the exception type to decide where to look for the cause
  • Prevent the most common exceptions with a check where an empty or missing value is expected

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.