sum = 0; more = 'y' # initialize an accumulator variable while more == 'y': value = input("Enter an integer: ") sum = sum + value # add it to the accumulator more = raw_input('Sum more values? (y for yes): ') print "Your total is: %d" % sum