I have a Python program where division is happening, but sometimes the divisor
is zero, which causes my program to crash. Here’s a simplified version of the
code:
def divide(a, b):
return a / b
print(divide(10, 0))
This throws a ZeroDivisionError. What’s the best way to handle this situation
gracefully in Python, so my program doesn’t crash?
Thanks in advance for your help!
https://apkhappymod.org/
_______________________________________________
Isbg mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/isbg.python.org/
Member address: [email protected]