Quiz on User-Defined Exceptions in Python



1. What is a user-defined exception in Python?
2. How do you define a user-defined exception in Python?
3. What keyword is used to raise a user-defined exception?
4. Which of the following is an example of a user-defined exception?
5. Can user-defined exceptions be caught using try-except blocks?

Advertisements