Overview
Sum all numbers in a list; divide by count for the average.
Analogy
Adding up your grocery bill then finding the average item price.
Step-by-step
- total = sum(numbers) (or manual loop).
- count = len(numbers).
- average = total / count (check count != 0 first).
- Return or print both values.
Visual
[1,2,3,4,5] → sum=15, len=5 → average=3.0
Common mistakes
- ZeroDivisionError when the list is empty.
- Integer division losing decimal: use / not //.
Practice questions
- Compute the average exam score for a class.
- Find the sum and average of even numbers only.