Year 8 · Python · Challenge 2

Student Quiz Score Analyzer

Loop through quiz scores to find the average, highest and lowest scores, and count how many students passed.

1D arrayaveragemax / mincount

Scenario: A teacher has recorded the scores of 10 students on a recent computer science quiz. The scores are stored in a 1D array. The quiz was out of 50 points. Build a small program to perform a basic analysis of the results.

Data

quiz_scores = [45, 32, 28, 50, 15, 41, 39, 22, 48, 35]

Your tasks

Analyse these scores by iterating through the array — not by using sum(), max() or min().

  1. Calculate the average score — total all scores, then divide by the number of students. Print the average.
  2. Identify the highest and lowest scores — print both values.
  3. Count passing students — a pass is 25 or more points. Print how many students passed.
💡 Try the whole challenge in your editor first. Only reveal the solution when you have had a proper go.

Previous: Challenge 1 · Year 8 Python · Next: Challenge 3