Kabir has played seven gully cricket matches this month. His scores were: 12, 25, 8, 25, 40, 15 and 101. His friends want to know: what is Kabir's "usual" score?
That sounds like a simple question, but there are actually three different answers, and each one tells a slightly different story. They are called the mean, the median and the mode. Let's work them out by hand, then check them with Python.
The mean: share it out equally
The mean is what most people call the "average". Add up all the values, then divide by how many there are.
12 + 25 + 8 + 25 + 40 + 15 + 101 = 226
226 ÷ 7 = 32.3 (rounded to one decimal place)
Think of it like this: if all of Kabir's runs were shared out equally across the seven matches, he would get about 32 runs per match.
The median: the middle one
The median is the middle value once everything is in order. First, sort the scores from smallest to largest:
8, 12, 15, 25, 25, 40, 101
There are 7 scores, so the middle one is the 4th. The median is 25.
If there is an even number of values, there are two middle values. Then the median is halfway between them (add them and divide by 2).
The mode: the most common one
The mode is the value that appears most often. Kabir scored 25 twice, and every other score only once. So the mode is 25.
Some lists have no repeated values, and some have two or more modes. The mode is especially useful for things that are not numbers, like "most popular colour of school bag".
Which one is "usual"?
Here is the interesting part. The mean is 32.3, but Kabir scored more than 32 in only two of his seven matches! Why is the mean so high?
Because of that one amazing innings of 101. A value that is much bigger or smaller than the rest is called an outlier. Outliers pull the mean towards them. The median, which just looks at the middle position, hardly notices them.
So if someone asks "what does Kabir usually score?", the median of 25 is probably a fairer answer. If they ask "how many runs does he score per match, overall?", the mean is the right tool.
This idea matters far beyond cricket. When news reports talk about "average" incomes or house prices, a few very large values can push the mean well above what most people actually have. That is why statisticians often report the median too.
Try it: check your answers with Python
Python has a built-in statistics module, so you do not need to install anything.
- First, work out the mean, median and mode yourself on paper using Kabir's scores.
- Open Python and type the program below.
- Run it and compare Python's answers with yours.
- Look at the second part of the output: what happens when we remove the 101?
# Mean, median and mode of runs scored in 7 gully-cricket matches
import statistics
runs = [12, 25, 8, 25, 40, 15, 101]
print("Runs:", runs)
print("Sorted:", sorted(runs))
print("Mean:", round(statistics.mean(runs), 1))
print("Median:", statistics.median(runs))
print("Mode:", statistics.mode(runs))
# What happens without the one huge score?
usual = [r for r in runs if r != 101]
print()
print("Without the 101:")
print("Mean:", round(statistics.mean(usual), 1))
print("Median:", statistics.median(usual))
The output is:
Runs: [12, 25, 8, 25, 40, 15, 101]
Sorted: [8, 12, 15, 25, 25, 40, 101]
Mean: 32.3
Median: 25
Mode: 25
Without the 101:
Mean: 20.8
Median: 20.0
Removing one score dropped the mean by more than 11 runs, but the median moved by only 5. That is the outlier effect in action. Notice the new median is 20.0: with six scores, the two middle values are 15 and 25, and halfway between them is 20.
Practise with your own data
- Write down the marks from your last five tests (or the daily temperature in your city for a week). Find the mean, median and mode by hand.
- Put your numbers into the
runslist and check with Python. - Invent a list where the mean and median are exactly the same. What does that list look like?
- Invent a list where the mean is much bigger than the median. What did you have to add?
For parents
Mean, median and mode are part of the school maths syllabus, but children often memorise the steps without knowing when to use which. The outlier example builds real understanding. A good follow-up question at home: "If a news report says the average is high, could a few big numbers be pulling it up?"
What you learned
- The mean adds everything and divides by how many values there are.
- The median is the middle value after sorting.
- The mode is the value that appears most often.
- An outlier can pull the mean a long way, while the median stays steady.
- Python's
statisticsmodule can check your answers in seconds.
Keep exploring
Averages are only the beginning of describing data. In a full statistics and computational thinking course, students go on to measure how spread out data is, draw histograms and box plots, spot relationships between two things, and explore chance and probability. Want to build more? Book a free demo class and see how maths comes alive with real data and code.