Unit 3 Task 16: Attendance tally

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 3 Task 16 - Attendance tally

← Unit 3 tasks - Solution


Start with an empty dictionary mapping student name -> number of days present.

Repeatedly ask for a name until the user types done. Each time, if the name is new, start their count at 1; if already present, add 1 to their count.

At the end, print every student and how many days they were recorded.

Skills: dict default pattern, keys, values.