Skip to content

Practical exercise

Build a class roll call program

A list lets you keep many names in one box. Today you will store the names of your real classmates or family members, count them, sort them, and pick a random one. By the end you will see why every roll call, every leader board, every WhatsApp group is just a list under the hood.

30 min·practitioner
Mimi the mascot, encouraging you

Now try it

Build a class roll call program

Stretch

Make it interactive. Replace the hardcoded list with a loop that asks the user how many students, then asks each name with input(). Save and run with a real classroom of 30 names.

Goes into your portfolio

Three screenshots showing the program output with three different randomly chosen students, plus the final Python code that includes sort, append, and random choice.