CSC108-Fall-2022-A2
README.md

CSC108-Fall-2022-A2

Assignment 2 of CSC108 University of Toronto 2022 CSC108 Assignment 2: Carbon Emissions

Carbon dioxide (C02) emissions are the main human-related contribution to the greenhouse gas emissions leading to climate change. Consequently, many people around the globe are interested in carbon emissions and there are a number of publicly available data sets related to this topic. In this assignment, you will use your newly-developing programming skills to answer some basic questions about global carbon emissions such as the country with the largest per-capita emissions in a given year or the average emissions from a particular country over a range of years. For this analysis, we will be using data collected by Gapminder that is available for free and updated regularly. To make sure that the data is stable for you and to do a tiny bit of clean up on it, we have already downloaded the data and are providing it with the starter code. You do not need to download your own data from Gapminder. In this assignment, we will use two Gapminder data tables. Each provides data for the same set of countries (in the same order) for a range of years. One of the tables holds the pounds of CO2 emissions per person for each year. The other has the country's population for each year.

The purpose of this assignment is to give you practice using the programming concepts that you have seen in the course so far, including (but not limited to) strings, lists and list methods, and loops. We also want you to see how you can use programming to answer real questions you have about large publicaly-available data. Although we will only look at carbon emissions, you could use your Python skills to investigate other trends in the the other large data sets available through Gapminder.

Files to download:

  • Starter code: carbon_emissions.py The carbon_emissions.py file contains some constants that you are expected to use. It also contains headers and docstrings for the A2 functions to which you are required to add function bodies. For each function, read the header and docstring (especially the examples) to learn what task the function performs. Doing so may help you to determine what you need to do for each required function. To gain a better understanding of each function, you should add at least one more example to the docstring for each function that has existing examples.

  • Data: co2_emissions_per_person.csv and populations.csv These two data files are in comma-separated values (CSV) format. You will read data from these files and you must not modify them

  • Checker: a2_checker.py We have provided a checker program (a2_checker.py) that tests two things:

  1. whether your functions have the correct parameter and return types, and
  2. whether your code follows the Python and CSC108 style guidelines. The checker program does not test the correctness of your functions, so you must do that yourself.

This project was done on Wing IDE.