2020-04-06 14:49:56 -04:00
|
|
|
---
|
|
|
|
id: 5e7b9f140b6c005b0e76f07d
|
2020-04-21 23:37:02 -05:00
|
|
|
title: 'Web Services: JSON'
|
2020-04-06 14:49:56 -04:00
|
|
|
challengeType: 11
|
2020-05-25 19:15:32 +05:30
|
|
|
isHidden: true
|
2020-04-06 14:49:56 -04:00
|
|
|
isRequired: true
|
|
|
|
videoId: ZJE-U56BppM
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
question:
|
2020-05-28 22:40:36 +09:00
|
|
|
text: "What will the following code print?:
|
2020-04-06 14:49:56 -04:00
|
|
|
<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
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|