2020-04-06 18:49:56 +00:00
|
|
|
---
|
|
|
|
id: 5e7b9f0a0b6c005b0e76f06c
|
2020-04-22 04:37:02 +00:00
|
|
|
title: The Tuples Collection
|
2020-04-06 18:49:56 +00:00
|
|
|
challengeType: 11
|
|
|
|
videoId: 3Lxpladfh2k
|
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --question--
|
2020-04-06 18:49:56 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --text--
|
2020-04-06 18:49:56 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
What will the following code print?:
|
2020-04-06 18:49:56 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```python
|
|
|
|
d = dict()
|
|
|
|
d['quincy'] = 1
|
|
|
|
d['beau'] = 5
|
|
|
|
d['kris'] = 9
|
|
|
|
for (k,i) in d.items():
|
|
|
|
print(k, i)
|
|
|
|
```
|
|
|
|
|
|
|
|
## --answers--
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
k i
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
k i
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
k i
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
---
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
quincy 0
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
beau 1
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
kris 2
|
2020-06-23 12:06:39 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
quincy 1
|
|
|
|
|
|
|
|
beau 5
|
|
|
|
|
|
|
|
kris 9
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
1 quincy
|
|
|
|
|
|
|
|
5 beau
|
|
|
|
|
|
|
|
9 kris
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
3
|
2020-04-06 18:49:56 +00:00
|
|
|
|