Graded Problem Set #3.4
File Problem

Background

These problems should be completed on your own. Unlike the practice problems, where you are allowed, and even encouraged, to talk about the process with your classmates, these should be attempted on your own. If you have difficulty with these, please reach out to me for assistance or guidance.

These problems will be completed using an editor such as Thonny or IDLE and submitted to Autolab for grading.

 

Introduction

We all love a good Olympic story. I mean, who didn't tear up when they watched the Jamaican bobsled team in Cool Runnings?

Image result for cool runnings

We all cheer for the good old U.S. of A. but we also like to cheer for the underdogs. But what exactly does it mean to be an underdog? Sure, a team that doesn't even really know about snow is an underdog. But other than that, a single medal won by a team from a tiny country just might be more impressive than 3 medals won by a much larger country.

In this activity you will look at the ratio of size of a country compared to the # of medals it won to try to figure out which countryreally performed better than we might expect.


Program Guide

For this assignment you should create the following functions in a file called olympics.py. You will make three functions. The first two are smaller, helper functions, that will be used by the third function

For this assignment you will be working with several potential data sets:

 

Create a function called: totalPopulation()

This function should:

 

Create a function called: totalMedals()

This function should:

 

Create a function called: medalRatios()

This function should:

 

Optional

Extend the previous function: medalRatios_with_category()

This function uses what you did previously but adds one more column to the output file. Once you have medalRatios() working you should copy and paste the function and then change the name to