freeCodeCamp/curriculum/challenges/english/07-scientific-computing-wit.../python-for-everybody/web-services-json.english.md

644 B

id title challengeType isRequired videoId
5e7b9f140b6c005b0e76f07d Web Services: JSON 11 true ZJE-U56BppM

Description

Tests

question:
  text: "What will the following code print?
<pre>import json<br>
<br>
data = '''<br>[<br>  { 'id' : '001',<br>    'x' : '2',<br>    'name' : 'Quincy'<br>  } ,<br>  { 'id' : '009',<br>    'x' : '7',<br>    'name' : 'Mrugesh'<br>  }<br>]'''<br>
<br>
info = json.loads(data)<br>
print(info[1]['name'])</pre>"
  answers:
    - 'Quincy'
    - 'Mrugesh'
    - '001'
    - '009'
    - '[Error]'
  solution: 2