# Program to show archetypal while loop # Matt Bishop, May 4, 2009 # for ECS 10 Spring 2009 # just counts from 1 to 10 def main(): # the for loop first print "for loop counting from 0 to 4:" for i in range(5): print i # now, the same while loop print "while loop counting from 0 to 4:" i = 0 while i < 5: print i i += 1 main()