Weather Statistics Challenge

Weather Data for Quebec City, Canada


For this challenge we will use a two-dimensional array (in Python a list of lists) to store the average temperature (in Celsius degrees) and the rainfall (in mm) for each of the twelve months of the year for Quebec City, Canada.

We will populate our array called quebec with the following data:

weather-data

Source: https://en.climate-data.org/location/663/

The aim of this challenge is to use a Python script to scan through all this data to calculate and display:

  • The average temperature throughout the year,
  • The hottest month of the year,
  • The total amount of rainfall throughout the year,
  • The average rainfall throughout the year,
  • The coldest month of the year,
  • The difference in rainfall between the wettest and the driest month of the year,
  • The average temperature during the wettest month of the year,
  • The average temperature during the driest month of the year,
  • The average Temperature during the three winter months, December, January, February.

The data provided above can also be represented using an “Average Temperature and Rainfall Chart”. You can use this chart to compare and check the outcomes of your Python script with the information provided on this chart.

Python Code


We have started the code for you. Analyse this code and reuse similar algorithms to complete this challenge.

unlock-access

Solution...

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.2 / 5. Vote count: 9

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

As you found this challenge interesting...

Follow us on social media!