The accumulator pattern:
Initialize a variable to store the running total (usually ) Loop through all values Add each value to the total After the loop, the total holds the sum
For this problem:
n = int(input()) # How many numbers
total = 0 # Accumulator
for _ in range(n): # Loop n times
num = int(input()) # Read a number
total += num # Add to total
print(total) # Output result
The underscore _ is a convention for loop variables you don't use. We only care about the count, not the index values.