2020-08-13 12:00:20 +02:00
|
|
|
---
|
|
|
|
id: 5e7b9f0a0b6c005b0e76f069
|
|
|
|
challengeType: 11
|
|
|
|
videoId: EEmekKiKG70
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: dictionaries-and-loops
|
2020-08-13 12:00:20 +02:00
|
|
|
---
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --description--
|
|
|
|
|
2020-08-13 12:00:20 +02:00
|
|
|
More resources:
|
2020-12-16 00:37:30 -07:00
|
|
|
|
|
|
|
\- [Exercise](https://www.youtube.com/watch?v=PrhZ9qwBDD8)
|
|
|
|
|
|
|
|
# --question--
|
|
|
|
|
|
|
|
## --text--
|
|
|
|
|
|
|
|
What will the following code print?:
|
|
|
|
|
|
|
|
```python
|
|
|
|
counts = { 'chuck' : 1 , 'annie' : 42, 'jan': 100}
|
|
|
|
for key in counts:
|
|
|
|
if counts[key] > 10:
|
|
|
|
print(key, counts[key])
|
2020-08-13 12:00:20 +02:00
|
|
|
```
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
## --answers--
|
|
|
|
|
|
|
|
annie 42
|
|
|
|
|
|
|
|
jan 100
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
chuck 1
|
|
|
|
|
|
|
|
annie 42
|
|
|
|
|
|
|
|
jan 100
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
chuck 1
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
[Error]
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
1
|
|
|
|
|