Created
November 24, 2018 05:11
-
-
Save lakinwecker/5100cb1d025ed0c6d0ccb7fec3b4d656 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
>>> var = "foo" | |
>>> print(var) | |
foo | |
>>> def bar(): | |
... var = "bar" | |
... print(var) | |
... | |
>>> bar() | |
bar | |
>>> print(var) | |
foo | |
>>> def baz(): | |
... global var | |
... var = "baz" | |
... print(var) | |
... | |
>>> baz() | |
baz | |
>>> print(var) | |
baz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment