Skip to content

Instantly share code, notes, and snippets.

@patrickgombert
Created January 19, 2018 19:51
Show Gist options
  • Save patrickgombert/ea63a2b5fe42f9479df138be327aa027 to your computer and use it in GitHub Desktop.
Save patrickgombert/ea63a2b5fe42f9479df138be327aa027 to your computer and use it in GitHub Desktop.
>>> if True:
... for i in [1, 2]:
... print(i)
... else:
... print("else")
...
1
2
else
>>> def foobar():
... for i in []:
... pass
... else:
... print("else")
...
>>> foobar()
else
>>> def foobar():
... for i in []:
... raise Exception()
... else:
... print("else")
...
>>> foobar()
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment