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

Popular posts from this blog

State use of pep and pip