London 2012


Learning Objectives

In this challenge we are going to investigate methods that can be used to:

  • Read and extract data from a text file,
  • Sort this data in ascending or descending order,
  • Display this sorted data on screen.


We have a text file with the list of the 10 top countries at the London 2012 Olympic Games. (Countries which won the most gold medals). This data is not sorted and is organised as follows:

Name of Country;Number of Gold Medals;Number of Silver Medals;Number of Bronze Medals

You can download this text file:


Step by Step

To achieve our goal of reading the text file, sorting its data and displaying it on the screen we will proceed in 5 steps:

Python Code

Your Challenge

Tweak this code to:

  • Sort this list in ascending order of gold medals
  • Sort this list in alphabetical (ascending) order of name of country
  • Sort this list in descending order of silver medals
  • Sort this list in descending order of bronze medals
  • Sort this list in descending order of total number of medals (Bronze + Silver + Gold medals)



The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.5 / 5. Vote count: 4

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: , ,