Skip to content

Instantly share code, notes, and snippets.

@ntcho
Created March 20, 2017 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntcho/9bfba020ab45c4d43d9a7b6f5d2395eb to your computer and use it in GitHub Desktop.
Save ntcho/9bfba020ab45c4d43d9a7b6f5d2395eb to your computer and use it in GitHub Desktop.
Python's programmatic flow
def print_lyrics():
print "I'm a lumberjack, and I'm okay"
print "I sleep all night and I work all day"
# repeat_lyrics()
# return an error: "NameError: name 'repeat_lyrics' is not defined"
def repeat_lyrics():
print_lyrics()
print_lyrics()
repeat_lyrics()
# might be copyrighted content
# from the book called "Think Python: How to Think Like a Computer Scientist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment