Team Generator

team-1

Context


A primary school teacher has a class of 30 pupils. (See attached file called class.txt).
They would like you to create a Python script that will help them make teams for group activities.

Your program should ask the number of teams the teacher needs (between 2 and 6), read the names of the pupils from the text file and assign pupil randomly to teams. However there should be roughly (or exactly when possible) the same number of pupils in each team.


TextFile
class.txt


team-2

Learning Objectives


In this challenge you will learn how to read data from a text file. The file given is a CSV file. CSV stands for Comma Separated Values. Which means each record (pupil) is stored on a line of the file. On each line the two fields (firstname and lastname) are separated using a comma.

Before attemtping to complete this challenge, make sure you read about file handling operations using Python.

Complete the code

team-3

Challenge #2: Random Name Picker


The primary teacher sometimes asks questions to the whole class. They would like to have a program that helps them randomly pick a name from their class list. They would like to make sure that once a name has been picked up once, they cannot be picked up a second time.

Using the class.txt file, write a Python program to meet the teacher’s requirements.

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 3

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!