Created
May 9, 2019 08:54
-
-
Save ItsCosmas/6384ca1cd2773a149473f8cb128b329d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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