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