Unit 3 Task 6 - Solution

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

Solution - Task 6: Team roster

← Back to task


One possible program:

roster = []

while True:
    player = input("Player name (or 'done'): ").strip()
    if player.lower() == "done":
        break
    roster.append(player)

print("Team has", len(roster), "players:")
for name in roster:
    print(name)