Sep-04-2019, 07:57 AM
(This post was last modified: Sep-04-2019, 07:57 AM by starter_student.)
(Sep-03-2019, 03:59 PM)buran Wrote: line 10 should befor city in data["list"]:
Note that you will need to change also line 17-19, in order to get min and max temp, but I will leave this to you for now
Hey!
Thank you! I didn't see that :) ... anyway I've changed it but till got the same KeyError: "list"
# Retrieve city names cities = [] for city in data["list"]: cities.append(city["list"][1]["name"]) # Retrieve temperatures min_temp, max_temp = [], [] for elt in data["list"]: min_temp.append(elt["list"][0]["main"]["temp_min"]) max_temp.append(elt["list"][0]["main"]["temp_max"])