Question: Using an API, I am pulling information from a url, and keep getting an error. Needing to know how to fix the error I keep
Using an API, I am pulling information from a url, and keep getting an error. Needing to know how to fix the error I keep getting that states string indices must be integers in the following code:
import urllib.request import json link = "url" f = urllib.request.urlopen(link) data = f.read() print (str(data, 'utf-8')) weather = json.loads(data) print('/n') print(weather["name"]["temp"])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
