value = input("Enter an integer: ") sum = 0; # initialize an accumulator variable for i in range(1, value): if i % 5 == 0: # if the index is divisible by 5 sum = sum + i; # add it to the accumulator print "In the range 1 through %d" % value + \ "\n\tthe sum of the numbers that are divisible by 5 = %d" % sum