Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Created April 9, 2020 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lakshay-arora/d5b9e2028ff8804a0179d3892b84b427 to your computer and use it in GitHub Desktop.
Save lakshay-arora/d5b9e2028ff8804a0179d3892b84b427 to your computer and use it in GitHub Desktop.
# function to divide two numbers
def division(a, b):
return a/b
# function works fine when you try to divide the number by a non-zero number
division(10, 2)
# >> 5.0
division(10,-3)
# >> -3.333333334
# Error when you try to divide the number by zero
division(10,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment