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 print url for story in json_obj['list']['story']: print story['title']['$text']
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 http://api.npr.org/query?apiKey=API_KEY&numResults=3&format=json&id=152285927 IRS May Soon Use Private Debt Collectors Coal Offers Hope For Montana Tribe Volkswagen Offers Cash, Vouchers To Defrauded Diesel Owners None