Answers for "catch division by zero python"

0

handling zero division error in python

x = 0
try:
  answer = 1/x
except ZeroDivisionError:
  answer = 'undefined'
print('The answer is {result}'.format(result=answer)
Posted by: Guest on May-25-2021

Code answers related to "catch division by zero python"

Python Answers by Framework

Browse Popular Code Answers by Language