Created
July 31, 2017 02:55
-
-
Save thebopshoobop/3058d8d68663b298a3651fe999ae20a7 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
the_word = 'bird' | |
def foo(): | |
print(the_word) | |
def baz(): | |
print(the_word) | |
the_word = 'is too long' | |
foo() # 'bird' | |
baz() # UnboundLocalError: local variable 'the_word' referenced before assignment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment