# define a list of numbers (like a key)
numbers = [2, 2, 3, 4, 5]
# set value of variables to store the sum and product
sum_of_numbers = 0
product_of_numbers = 1
# calculate the sum and product with iteration
for num in numbers:
sum_of_numbers += num
product_of_numbers *= num
# the results are then prnted
print("List:", numbers)
print("Sum of numbers:", sum_of_numbers)
print("Product of numbers:", product_of_numbers)
List: [2, 2, 3, 4, 5]
Sum of numbers: 16
Product of numbers: 240
The program above essentially calculates the sum and product of numbers in a list. It starts by defining a list of numbers to then initialize variables to store the sum and product. It then iterates through the list, adding each number to the sum and multiplying it with the product. Finally, it prints out the original list of numbers, the sum, and the product as the results.