Answer to Question #185253 in Python for Fortune Aidoo

Question #185253
2. Write your own unique Python program that has a runtime error. Do not copy the program from your textbook or the Internet. Provide the following.

The code of your program.
Output demonstrating the runtime error, including the error message.
An explanation of the error message.
An explanation of how to fix the error.
1
Expert's answer
2021-04-28T09:51:10-0400
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



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS