Zero division error


#1

print(A/B)

produces a runtime error when B is equal to zero
any solns??


#2

First things first, you can’t divide an integer or float with zero, to bypass this when B==0 you just won’t divide.
Secondly, the test cases for the solution don’t contain a zero for B, so, no need to worry.


#3

if you are that much curious on zero division error you can go for exception handling
try:
a = 8
b = 0
c = a / b
except ZeroDivisionError:
c = 0