Challenge 3: Co2 Emissions

Suggested time: 25 minutes

A text file contains carbon dioxide (Co2) emissions for 10 countries around the world. A program is needed to read the data from a text file and display it as a table as shown below:

Example program output

Using the file below:

Amend the program to meet the following requirements:

  • All data in emmisions.txt must be processed
  • Results must be displayed in columnar format, using <string>.format()

Do not change any other functionality.

If this was a real question it would tell you to save your code as but you might want to save your code so you can show your teacher or come back to it later by pressing Ctrl + S or clicking on the icon that looks like this:

Save / share icon in lets you save your code