This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with Python Forum

View Course » View Exercise

572 points
54bbc4a99113cb9116003ab6_938228051
Submitted by
Kewlgirl88
over 2 years ago

NPR API Making A Request 5/20 problem

Hi! I kinda need help on NPR API 5/20. Can you help me? This is Python, if your asking. Here is my code:

from urllib2 import urlopen

# Open http://placekitten.com/ for reading on line 4!
kittens = urlopen('http://placekitten.com/')                     print body 
response = kittens.read()
body = response[559:1000]

# Add your 'print' statement here!

Please tell me how to correct it!


1 vote

permalink

Type print body instead of rint body

199 points
E7aa8b02ad23e6a3114a919ffc86e5b9?s=140&d=retro
Submitted by
Bhuvana Chandra
over 2 years ago


0 votes

permalink

from urllib2 import urlopen

Open http://placekitten.com/ for reading on line 4!

kittens = urlopen('http://placekitten.com/')
response = 'kittens.read()'
body = response[559:1000]

print body

398 points
86367c0f6f6a394dc5a6f4c8b16ab948?s=140&d=retro
Submitted by
veroregg
over 2 years ago