# File: while.py # Program to show archetypal while loop # # Matt Bishop, ECS 10, Spring 2014 # # just counts from 1 to 10 # 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