Created
October 17, 2022 16:30
-
-
Save werterzz/6543bdb098e8e327ce3d49066a0f8ab4 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
# global scope | |
outer = "eggshell" | |
def egg(): | |
# enclosing scope | |
middle = "egg white" | |
def inner_egg(): | |
# local scope | |
inner = "yolk" | |
print("global scope: " + outer) | |
print("enclosing scope: " + middle) | |
print("local scope: " + inner) | |
inner_egg() | |
# built-in scope (preserve keyword ex. if, for, break, continue) | |
return True | |
egg() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment