QUESTION IMAGE
Question
question # 5
dropdown
suppose you are writing a program to sell tickets to a concert. the maximum number of tickets available is 400.
you created your own error type.
class over400error(exception):
pass
what is the missing term in the code that handles that error?
if tickets > 400:
over400error
Step1: Identify error - raising situation
In Python, when a custom - defined error condition occurs, we need to raise the custom error. Here, when the number of tickets is greater than 400, we should raise the Over400Error which we have defined.
Step2: Recall Python error - raising syntax
The syntax to raise an error in Python is raise <error - class>.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
raise