Your turn to practice
A weather station records the average monthly temperature of a city.
Use the following dataset.
| Month | Average Temperature (°C) |
|---|---|
| January | 12 |
| February | 15 |
| March | 20 |
| April | 26 |
| May | 32 |
| June | 36 |
| July | 35 |
| August | 33 |
| September | 30 |
| October | 25 |
| November | 19 |
| December | 14 |
Identify:
Create two lists:
months = [...]temperature = [...]
Fill these lists using the dataset.
Use:
plt.plot(months, temperature)
Display the chart.
Your chart should contain:
Use circular markers to show individual temperature values.
Hint:
marker="o"
Change the line color to red.
Hint:
color="red"
Display gridlines to make temperature values easier to read.
Hint:
plt.grid(True)
Answer these questions:
Your learning challenge
Complete the Python program yourself before looking for a solution.
Prepare the two Python lists.
Create the basic line chart.
Add title and axis labels.
Add markers, color, and gridlines.
Interpret the temperature trend.
0 of 5 tasks completed