Skip to content

Instantly share code, notes, and snippets.

@ItsCosmas
Created May 9, 2019 08:54
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 ItsCosmas/6384ca1cd2773a149473f8cb128b329d to your computer and use it in GitHub Desktop.
Save ItsCosmas/6384ca1cd2773a149473f8cb128b329d to your computer and use it in GitHub Desktop.
# RAISING EXCEPTIONS
print("Some Text")
raise ValueError
print("Something Else")
# Detail Exception
name = "1234"
raise NameError("Invalid Name")
# Raise in Except
try:
word = "spam"
print(word/0)
except:
print("An Error Occured")
raise
finally:
print("This code will run no matter what errors")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment