-
-
Save vext01/ae45fb890897b6a423b8 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
x = 666 | |
def print_x(): | |
print(x) # OK, you can see x | |
def copy_x(): | |
y = x # ok, you can copy x | |
def inc_x(): | |
x = x + 1 # local variable 'x' referenced before assignment?! | |
print("print_x") | |
print_x() | |
print("copy_x") | |
copy_x() | |
print("inc_x") | |
inc_x() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment