Question #7
Match List
Place the code in the correct order.
Assume the indenting will be correct in the program.
Third part
Second part
Fifth part
Fourth part
First part

Question 7 Match List Place the code in the correct order Assume the indenting will be correct in the program Third part Second part Fifth part Fourth part Firs class=

Respuesta :

Answer:

I put an attachment with the answer

Explanation:

edge

Ver imagen abonibale
fichoh

The correct ordering of the python program which raises an exception based on the number of tickets to be ordered is given below :

class Over400Error(Exception):

pass

#define the over400 class

tickets = input("How many tickets? ")

tickets = int(tickets)

costEach = 25

#user input for number of tickets and price per ticket

try :

if tickets > 400 :

raise Over400Error

else:

cost = tickets * costEach

print("You owe $", str(cost))

#try portion displays the total ticket cost if units is less than 400

except Over400Error:

print("You cannot order over 400 tickets. ")

#rather than throwing an error, this message is displayed for tickets above 400 units.

A sample run of the program is attached.

Learn more : https://brainly.com/question/19868999

Ver imagen fichoh
Ver imagen fichoh