Skip to content

Instantly share code, notes, and snippets.

@ItsCosmas
Created May 9, 2019
Embed
What would you like to do?
# 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