Part of the series

Several example codes

~1 min read • Updated Sep 23, 2025

Program Overview

This Python program receives a list of numeric values and calculates the total sum.
It’s useful for data analysis, score aggregation, or summarizing transaction amounts.


Python Code:


# Sample list of numbers
numbers = [10, 25, 30, 5, 15]

# Calculate the sum using the built-in sum function
total = sum(numbers)

# Display the result
print("Sum of list values:", total)

Sample Output:


Sum of list values: 85

Explanation:

- The list numbers contains several integer values
- The sum() function computes the total of all elements in the list
- The final result is printed using print()


Written & researched by Dr. Shahin Siami