This lesson says that I pass, but the result doesn't look how I would expect it to be.
Here's my code:
from urllib2 import urlopen
from json import load
url = "http://api.npr.org/query?apiKey="
key = "API_KEY"
url += key
url += '&numResults=3&format=json&id='
response = urlopen(url)
json_obj = load(response)
npr_id = raw_input("Which story would you like to load?")
url += npr_id
for story in json_obj['list']['story']:
Here's what the console prints out when I type in the ID 152285927 as the lesson instructs:
Which story would you like to load? 152285927
IRS May Soon Use Private Debt Collectors
Coal Offers Hope For Montana Tribe
Volkswagen Offers Cash, Vouchers To Defrauded Diesel Owners