Skip to content

Instantly share code, notes, and snippets.

@language-engineering
Created October 2, 2012 11:14
Show Gist options
  • Select an option

  • Save language-engineering/3818251 to your computer and use it in GitHub Desktop.

Select an option

Save language-engineering/3818251 to your computer and use it in GitHub Desktop.
def test_iterate(number_of_iterations): #Function definition, takes one argument
for i in xrange(number_of_iterations): #The argument defines the number of times for which the loop will iterate.
print "Iteration %s" % i #Print which iteration you're on
test_iterate(10) #Call the function with an example iteration number "10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment