Answers for "what error does dividing by zero give in 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 "what error does dividing by zero give in python"

Python Answers by Framework

Browse Popular Code Answers by Language