A program that lets the user enter a series of numbers and calculates the sum of all the numbers.
def calculate_sum_of_numbers():
# Get the number of numbers from the user
num_of_numbers = int(input("How many numbers do you have? "))
# Initialize the sum
total_sum = 0
# Iterate based on the number provided by the user
for i in range(num_of_numbers):
# Get a number from the user and add it to the sum
user_input = float(input("Enter a number: "))
total_sum += user_input
# Display the sum
print("Sum:", total_sum)
# Run the program
calculate_sum_of_numbers()