Program to check for ZeroDivisionError Exception. ((MSBTE Pratical Question))
Code:
try:
a = int(input("Enter a
number: "))
b = int(input("Enter a
number: "))
c = a / b
print("Division:",c)
except ZeroDivisionError:
print("Can't divide by
zero!")
Output:
Comments
Post a Comment