Sep-04-2019, 08:24 AM
(Sep-04-2019, 08:16 AM)buran Wrote:(Sep-04-2019, 08:09 AM)starter_student Wrote: what is wring with my codethe way you try to access different parts in the JSON object, e.g.
for city in data["list"]: cities.append(city["list"][1]["name"])you loop over each element in data['list']. That is each city data beingdict
. Then you try to accesscity['list']
- there is no such key within city dict. Then you even try (not sure what) to use index as in list i.e.[1]
or key=1 as in dict with int keys... again - city is not a list, nor there is key=1 in city dict
same apply to part where you try to get temps
got it!. Thks