# print the sum of the first 5 positive integers, version 3 acc = 0 # initialize acc before the loop for x in range(1,6): acc = acc + x # accumulate values into acc each time through the loop print(acc) # use the final value of acc after the loop is over # The accumulator pattern -- but note that the variable needn't be "acc".