Rotate your phone or change to desktop for better experience

Rotate your phone or change to desktop for better experience

7. Demonstrate Exceptions in Python

 try:

a = int(input("Enter a:"))

b = int(input("Enter b:"))

c = a/b;

except ZeroDivisionError:

print("can't divide by zero")

else:

print("Program is executed Answers is =%d"%c)

finally:

print("I am In Finally Block.Program is closing Bye")

Post a Comment

0 Comments