How does a bar chart count the days at each temperature in a year, and how does alpha keep two overlapping years readable?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Each date is a string like '19610104' (year, month, day), and temps[i] is the reading for dates[i]. Build a list of the temperatures whose date falls in year, in their original order. A slice of the date string and == are all the test you need. Assign the list to new_temps.