Exception Handling
try:
x = 1 / 0
except ZeroDivisionError:
print("Cannot divide by zero")Try it Yourself
Run this PYTHON example in your local environment or course sandbox.
Python Tutorial
try:
x = 1 / 0
except ZeroDivisionError:
print("Cannot divide by zero")