A try statement has three except blocks, and the error fits more than one of them.
try:
nums = [1, 2, 3]
print(nums[3])
except ArithmeticError:
print("math")
except LookupError:
print("lookup")
except IndexError:
print("index")
What does the program print?
Log in to join the discussion.
Loading…