Home Schedule

Lab 6: Lists and Split (10 pts)

Setup

  1. Locate your "CS102" folder
  2. Download lab06.zip
  3. Extract the content of the zip file to lab06 in your CS102 folder
  4. Open "lab06.py" with Thonny
  5. READ THE COMMENTS
  6. Submit lab06.py to Moodle when you are finished

Now that we are writing functions, make sure your work today (and all future assignments) follows our class Python style guidelines and you include function comments. Be careful of your indentation!

Assignment

You will use Python to uncover some information about a dataset. The video_games.tsv is a tab-delimited data file (each field of data is sparated by a tab character). This file can be opened with Excel, Numbers, or some other spreadsheet application. You may browse the file and see the type of data that is present in the file. The lab06.py file is where you will write your code, and it already has a sample function that shows how to get data and calculate the average used price of a game published by Nintendo. All of the reading from the data file has been handled for you with the games.py file and you should not need to open that file with Thonny, however all files must remain in the same directory.

In a group, take some time to explore the data. Come up with three additional functions that present some information about the dataset. Some ideas might be:

None of your function definitions should print, they should all use the return statement to provide data. When you call your function, you will print the output to the screen neatly with a clear explanation of what the value represents (this will use the print function). Use the existing code as a guide.

Finished Early?