Exception Handling3
Exception Handling3
syllab
us
2023-
24
Chapter 3
Exception handling
Exception
Handling
except:
# optional block
# Handling of exception (if required)
else:
# execute if no exception
# handles zerodivision
exception except
ZeroDivisionError:
print("Can't divide by zero")
finally:
# this block is always executed
# regardless of exception
• Possible security
risks
Visit : python.mykvs.in for regular
• Performance overhead
• Increased code complexity
• Possible security
risks
Visit : python.mykvs.in for regular