Home โ€บ Learning paths โ€บ Exceptions

๐Ÿšจ Exceptions โ€” learning path

๐Ÿšจ Improver10 problemsFree ยท no login needed

What this path teaches

Exceptions as control flow: except-clause ordering, try/except/else, finally's guarantees, and the empty-input crashes (ZeroDivisionError) that every real program must decide a policy for.

By the end: You can choose between guarding, catching, and re-raising โ€” and order except blocks correctly.

Your progress

0 of 10 opened

Start the path โ†’

The problems, in order

  1. 1Dividing without checking for zero
    ๐Ÿ› Fix the bug ยท easy
  2. 2Average calculation crashes on empty input
    ๐Ÿ› Fix the bug ยท medium
  3. 3Average of an empty filtered list
    ๐Ÿ› Fix the bug ยท medium
  4. 4Division by zero in a list comprehension
    ๐Ÿ”ฎ Predict the output ยท medium
  5. 5try-except-else flow
    ๐Ÿ”ฎ Predict the output ยท medium
  6. 6Catching exceptions in the wrong order
    ๐Ÿ› Fix the bug ยท medium
  7. 7Multiple except with a shared exception
    ๐Ÿ”ฎ Predict the output ยท medium
  8. 8Finally block runs even after return
    ๐Ÿ› Fix the bug ยท medium
  9. 9Custom exception messages
    ๐Ÿ”ฎ Predict the output ยท medium
  10. 10Modifying a dict while looping over it
    ๐Ÿ› Fix the bug ยท medium

How to work a path

Do the problems in order โ€” each one assumes the rule taught by the one before it. Open a problem, try it in the interactive editor, and only then read the explanation. Progress is saved in this browser automatically (signed-in solves also earn XP and streaks). One path per week is a solid pace; finishing in a single sitting is allowed but not required.