# Program to show break and continue statements # Matt Bishop, May 4, 2009 # for ECS 10 Spring 2009 # this prints 1 2 4 5 on separate lines # initialize counter i = 0; # infinite loop; we drop out using a break statement while True: # next number i += 1 # if it's 3, do not print it; just go on to the next number if i == 3: continue # print it print i # if it's 5, exit loop; otherwise, go up to next number if i == 5: break