Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created April 30, 2021 05:26
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 velotiotech/228a0fd82d280f82866057a18d6ed2a4 to your computer and use it in GitHub Desktop.
Save velotiotech/228a0fd82d280f82866057a18d6ed2a4 to your computer and use it in GitHub Desktop.
def my_func(number):
try:
number = number / 0
except ZeroDivisionError:
print('Division by 0 is not allowed ', end='')
else:
print('Division successful ', end='')
try:
number = number / 5
except:
print('Exception occurred ', end='')
else:
print('Success', end='')
if __name__ == '__main__':
n = 10
my_func(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment