Python Tutorial

Python Try...Except

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.