I've created codes that collects weather data using JSON and API keys. However, all I really need is one value of one dictionary, but my code keeps returning "TypeError: list indices must be integers or slices, not str". What do I do.
Relevant Code:
Relevant Code:
url = "http://api.openweathermap.org/data/2.5/weather?q=brisbane&appid=7f50acdcb4d66b2117f7af48d489fbd4" response = urllib.request.urlopen(url) result_3 = json.loads(response.read()) weather = result_3['weather']['description'] print("ISS now at latitude: ", weather)'weather' dictionary:
[{'id': 800, 'main': 'Clear', 'description': 'clear sky', 'icon': '01n'}]