A programmer has written the Python program below to calculate the sum of all integers from 1 to 4 inclusive.
total = 0
for number in range(1, 5):
total = total + number
print(total)
The program needs to be modified so that it also calculates the product of (multiplies together) all of the integers from 1 to 4 inclusive.
Select the option that correctly modifies the program to achieve this.
total = 0
product = 1
for number in range(1, 5):
total = total + number
product = total * number
print(total)
print(product)
total = 0
product = 1
for number in range(1, 5):
total = total + number
product = product * number
print(total)
print(product)
total = 0
product = 1
for number in range(1, 5):
total = total + number
product = product * total
print(total)
print(product)
total = 0
product = 1
for number in range(1, 5):
total = total + number
product = (total + product) * number
print(total)
print(product)