Skip to content

Instantly share code, notes, and snippets.

@cdunklau
Forked from anonymous/gist:4aef3dfcf966a7fb246e
Last active August 29, 2015 14:20
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 cdunklau/c75085a97243ef3e6d55 to your computer and use it in GitHub Desktop.
Save cdunklau/c75085a97243ef3e6d55 to your computer and use it in GitHub Desktop.
def investigate_loop()
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
# Define the function
def investigate_loop()
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
# "Run" the function (call it)
investigate_loop()
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment