+ 1

How is it possible to work this out?

error for dividing by zero

25th Dec 2017, 4:57 PM
arbaaz
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.
25th Dec 2017, 5:04 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 2
Thank you for your answer.
24th Feb 2018, 11:08 PM
arbaaz