Skip to content

Project · Python Programming

Project: a class result sheet

Projectbeginner· about 3 hours· 7 steps

The brief

Turn one class's raw marks into a full result sheet: totals, percentages, grades with a fail rule, subject averages, a merit list, printed report lines and a class summary.

Why it matters

Every school and college office makes this sheet at result time, often by hand in a spreadsheet. A program does it in a second, never mistypes a total and can be rerun when a mark is corrected. It is also a common first freelance job: a coaching centre wants its test results worked out and ranked.

Skills you practise

  • lists of tuples
  • dictionaries
  • nested loops
  • if/elif/else grading
  • sorting tuples
  • f-strings

What you will have at the end

results.py: a result-sheet program that prints a ranked report line for every student and a class summary, ready to rerun when marks change.

How it is marked (rubric, 100 points)
Correct resultsAll seven checks pass, including the fail rule for Kabir and the exact report lines.45
Good use of collectionsDictionaries keyed by name, (total, name) tuples for sorting, no copied-out numbers.20
Readable codeClear variable names, one comment per step, no repeated blocks that a loop could do.20
Report a teacher can usePrinted lines are in merit order, tidy and match the format exactly.15

0/7 steps done

Step 1 of 7

Totals

totals maps each student's name to the sum of their five marks (Diya Nair: 457).

students is a list of (name, marks) tuples, so unpack each one in the loop. sum() adds a list of numbers. Store the result in the totals dictionary with the name as the key.

Run shows what your code prints. Check runs the step's tests. Ctrl+Enter checks too.