Last active
December 1, 2017 12:51
-
-
Save erikaris/c9dba6e2fd0bee3dd28b6c6e244afef1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# since there is a variable assignment inside function f, | |
# f will only care about the local variable 's' | |
# and will not think about the global variable 's' | |
def f(): | |
print(s) | |
s = "Mukhlisina" | |
print(s) | |
s = "Erika Siregar" | |
f() | |
print(s) # s here is the global s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment