You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A try statement can have more than one except clause, to specify handlers for different exceptions. Please note that at most one handler will be executed.
"""
# Program to handle multiple errors with one except statement
try :
a = 3
if a < 4 :
# throws ZeroDivisionError for a = 3
b = a/(a-3)
# throws NameError if a >= 4
print ("Value of b = ", b)
# note that braces () are necessary here for multiple exceptions