This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Ben Hirsch
about 10 years

Problem with instructions? Not sure whats wrong with this code, it should pass me.

from urllib2 import urlopen

from json import load

key = “API_KEY”

def buildapicall(key): url = ‘http://api.npr.org/stations?apiKey='+ key url += ‘&format=json’ zip_code = raw_input(‘Enter your zip code:’) url += ‘&zip=’+ zip_code return url

def callstationapi(url): response = urlopen(url) j = load(response) return j

url = buildapicall(key) print ‘URL:’ + url

jsonobj = callstationapi(url)

Answer 537d99f580ff3357de001001

0 votes

Permalink

change your print “URL:”+url into print “URL :”+url

points
Submitted by buu thong tran
almost 10 years