Py4e: Chapter 13- Questions and Answers|
Latest Update
what Python code would extract "Leah Culver" from the JSON? x["users"][0]["name"]
What library call do you make to append properly encoded parameters to the end of a URL like
the following:
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Ann+Arbor%2C+MI
urllib.parse.urlencode()
What happens when you exceed the Google geocoding API rate limit? You cannot use the
API for 24 hours
What protocol does Twitter use to protect its API? OAuth
What header does Twitter use to tell you how many more API requests you can make before you
will be rate limited? x-rate-limit-remaining
What Python library do you have to import to parse and handle JSON? import json
Which of these two web service approaches is preferred in most modern service-oriented
applications? REST - Representational state transfer
, What is the method used to parse a string containing JSON data so that you can work with the
data in Python? json.loads()
What is the name of the Python 2.x library to parse XML data? xml.etree.ElementTree
What is the method to cause Python to parse XML that is stored in a string? fromstring( )
In this XML, which are the "simple elements"?
<people>
<person>
<name>Chuck</name>
<phone>303 4456</phone>
</person>
<person>
<name>Noah</name>
<phone>622 7421</phone>
</person>
</people> name, phone
In the following XML, which are attributes?
<person>
<name>Chuck</name>
Latest Update
what Python code would extract "Leah Culver" from the JSON? x["users"][0]["name"]
What library call do you make to append properly encoded parameters to the end of a URL like
the following:
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Ann+Arbor%2C+MI
urllib.parse.urlencode()
What happens when you exceed the Google geocoding API rate limit? You cannot use the
API for 24 hours
What protocol does Twitter use to protect its API? OAuth
What header does Twitter use to tell you how many more API requests you can make before you
will be rate limited? x-rate-limit-remaining
What Python library do you have to import to parse and handle JSON? import json
Which of these two web service approaches is preferred in most modern service-oriented
applications? REST - Representational state transfer
, What is the method used to parse a string containing JSON data so that you can work with the
data in Python? json.loads()
What is the name of the Python 2.x library to parse XML data? xml.etree.ElementTree
What is the method to cause Python to parse XML that is stored in a string? fromstring( )
In this XML, which are the "simple elements"?
<people>
<person>
<name>Chuck</name>
<phone>303 4456</phone>
</person>
<person>
<name>Noah</name>
<phone>622 7421</phone>
</person>
</people> name, phone
In the following XML, which are attributes?
<person>
<name>Chuck</name>