Gunel :
I would like to automate the division by 0. Some of variable extracted from db might equal 0 and division would give an error. Should I make an exception In DB or in python code?
Mehrdad Pedramfar :
This is better:
for b in varb:
try:
v = 1/b # or any code that raises division by zero
print(v)
except ZeroDivisionError:
print(0)