+ 1
How is it possible to work this out?
error for dividing by zero
2 Answers
+ 9
1. Try to determine what causes the error and make sure you did your best to avoid that (try to ensure the divisor is never equal to zero).
If the above is not possible or not always possible:
2. Enclose that part of code generating the error with a try/except clause and specify how to proceed anyway, even if the error is encountered.
+ 2
Thank you for your answer.