Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created July 5, 2019 19:41
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 eyaltrabelsi/a7356ee02dfc34f2fd566eab23738ce3 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/a7356ee02dfc34f2fd566eab23738ce3 to your computer and use it in GitHub Desktop.
Python trick try catch construct
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