Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created October 19, 2015 07:29
Show Gist options
  • Select an option

  • Save accessnash/981ae200e342737288e9 to your computer and use it in GitHub Desktop.

Select an option

Save accessnash/981ae200e342737288e9 to your computer and use it in GitHub Desktop.
""" Exception handling while dividing integers"""
while True:
integer = input("Provide an integer: ")
try:
print(10/int(integer))
except ValueError:
print("Your input must be an integer")
except ZeroDivisionError:
print("Your input must not be zero")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment