Created
July 5, 2019 19:41
-
-
Save eyaltrabelsi/a7356ee02dfc34f2fd566eab23738ce3 to your computer and use it in GitHub Desktop.
Python trick try catch construct
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
try: | |
foo() | |
except Exception: | |
print("Exception occured") | |
else: | |
print("Exception didnt occur") | |
finally: | |
print("Always gets here") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment