Learn
Congratulations, you have now mastered many techniques for interacting with exceptions in Python! We learned:
- How exceptions differ from syntax errors
- How to read tracebacks
- How
try
/except
/else
/finally
provides us with a powerful control flow for handling exceptions - How to create and raise custom exceptions to provide more helpful errors to users of our code
These tools will get you very far as a Python developer!
Instructions
1.
The code in families.py
prints some instruments and the instrument families they belong to. It has some bugs in it. Can you find and fix the bugs? Consider adding some exception handlers so that you can print custom error messages the next time someone runs into these bugs!
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.