Created
February 24, 2019 07:54
-
-
Save pfreixes/65db5634a5723d0ffd6d3af18eaf0f5a to your computer and use it in GitHub Desktop.
Scope Python
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
$ python | |
Python 3.7.2 (default, Jan 13 2019, 12:51:54) | |
[Clang 9.0.0 (clang-900.0.39.2)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> dir() | |
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__'] | |
>>> f = [1, 2, 3] | |
>>> dir() | |
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'f'] | |
>>> for x in f: | |
... pass | |
... | |
>>> dir() | |
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'f', 'x'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment