Year 7 · Python · Challenge 3

Sports Day Scoreboard

Loop through race times entered by the user. Find the total, the average, and how many times beat the school record.

for loopsrunning totalcountingif

Scenario: On sports day, 6 runners finish a race. You will type in each runner’s time in seconds.

The school record is 12.5 seconds.

Your tasks

  1. Use a for loop to ask for 6 race times (use float).
  2. Keep a running total of all times.
  3. Count how many times are under 12.5 (faster than the record).
  4. After the loop, print the total time.
  5. Print the average time (total / 6).
  6. Print how many runners beat the school record.
💡 Start total = 0 and record_beaters = 0 before the loop. Add inside the loop.
💡 Try the whole challenge in your editor first. Only reveal the solution when you have had a proper go.

Previous: Challenge 2 · Year 7 tutorial · Next: Challenge 4