Python - Programming Language
This course covers the basics of programming in Python. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!

Try Except

Lesson 27
Author : GOUP
Last Updated : September, 2020


Code

Copy# code asks user for number and divides 10 by it
# enter '0' to trigger exception
try:
    answer = 10 / int(input("Enter Number: "))
except ZeroDivisionError as e:
    print(e)
except:
    print("Caught any exception")