Exception Handling in Python

Simple Python Script that demonstrates Exception Handling

Source code :

a = 1
b = 0

try:
    print(a/b)
    
except Exception as e:
    print("Error : " + str(e))

Output :

Error : division by zero

Output :


                

Comments :