number1 = float(input("number #1 = "))
number2 = float(input("number #2 = "))
divison_result = number1/number2
print("result of division: ", divison_result)
Runtime error: ZeroDivisonError
Explanation: This error occurs when you try to divide by zero
How to fix: you must check if number2 equals zero, if not, you can do division, otherwise notify a user that number2 can't be zero
Comments
Leave a comment