1
00:00:00,420 --> 00:00:04,250
You saw that looping through a list is straight forward.

2
00:00:04,260 --> 00:00:06,040
You just do it like that.

3
00:00:06,060 --> 00:00:10,160
However if you have a dictionary it this a bit more complex.

4
00:00:10,650 --> 00:00:18,000
Again you do for pick a variable name in the dictionary you want to iterate.

5
00:00:18,120 --> 00:00:23,130
But here you want to specify what you want to iterate.

6
00:00:23,160 --> 00:00:30,080
Do you want to iterate over items, keys, or values.
If you want to iterate over items, you'd apply

7
00:00:30,180 --> 00:00:31,320
.items(): there.

8
00:00:31,360 --> 00:00:35,950
Don't forget the colon and print(grades).

9
00:00:36,090 --> 00:00:36,810
See what .

10
00:00:40,020 --> 00:00:44,870
So you get these items printed out as a tuple.

11
00:00:44,880 --> 00:00:48,460
These are tuples.

12
00:00:48,960 --> 00:00:59,690
So the key and the value for each iteration.
If you wanted the keys instead it, you just write keys there.

13
00:01:00,110 --> 00:01:08,240
And if you wanted the values you just write .values(): and you get the values, that's how you iterate

14
00:01:08,300 --> 00:01:09,260
over dictionaries.

