Here's the complete solution: python n = int(input()) total = 0 for _ in range(n): total += int(input()) print(total) We can combine int(input()) directly in the += operation. No need for a temporary variable if we're only using the value once.
This pattern (initialize, accumulate, output) appears everywhere: - Sum of numbers. Product of numbers. Count of items matching a condition. Finding max or min learn this pattern and you've solved a huge class of problems.