GEN220_2023

2023 Class


Project maintained by biodataprog Hosted on GitHub Pages — Theme by mattgraham

This homework is about using your new Python skills.

We will write a couple of routines.

Part 1: Seating Chart

The starting script is called seating.py

A basic script has already been started for you in the github repository. Accept the assignment and then you will have a new repository created for you. Clone this library onto your computer to start editing or use github workspaces.

You will read in two files of data ‘guests.txt’ and will generate an assignment of guests to tables. So the first X number of individuals go to Table 1, next X go to Table 2, etc.

Print out the info like this. The number of people assigned to a table should be determined based on an input value of a number total tables. The default will be 4 tables for 20 people. But you should allow for the number of tables to be a variable you can set.

Eg you will print out:

Table 1: Brynn, Albert, Alyssa, Dirk Table 2: … Table 3: … Table 4: …

The skills for part 1 are focused on reading a file, updating a list, calculating length of a list

Part 2: Frequency Table

The starting script is called scattergories.py

You will read in a list of items that are organized by categories, each file is a different category the type of this category is coded by the name of the file. For example T-shirt is in a file called clothing.txt. So if I asked what is the category of T-shirt your program will return clothing

you’ll need to know how to open a folder and read the list of files - the template code already shows how to do some of this.

The skills for part 2 are to use a dictionary, to use re or other case to strip off the ending of the filename and store data in a dictionary.