47.7k views
1 vote
Fill in the missing word in this program. class TooWide(Exception): pass answer = input('How wide is it? ') width = float(answer) try: if width > 30: raise TooWide else: print("Have a nice trip!") -------TooWide: print("Your luggage will not fit in the overhead bin.")

User Gezzahead
by
4.9k points

2 Answers

7 votes

Answer:

except

Step-by-step explanation:

took test

User RAHUL KUNDU
by
4.4k points
1 vote

Answer:

Replace ______ with except

Step-by-step explanation:

Your program is an illustration to try except in Python

When the Python interpreter sees a try statement, it expects a corresponding an except statement

So, the complete program is:

class TooWide(Exception): pass

answer = input('How wide is it? ')

width = float(answer)

try:

if width > 30:

raise TooWide

else:

print("Have a nice trip!")

except TooWide:

print("Your luggage will not fit in the overhead bin.")

User Acassis
by
4.0k points