Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introducing Dictionaries!
You have completed Introducing Dictionaries!
Preview
Learn how to iterate over dictionaries using for loops.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
In the second half of this course, we'll
be discussing iteration, packing, and
0:00
unpacking.
0:02
Iterating over dictionaries uses a for
loop, just like iterating over sequences.
0:03
So continuing on with
our previous example,
0:08
here we have a simple
dictionary called course.
0:10
Let's write a basic loop to
iterate over the dictionary.
0:13
It should look very similar to a for
loop used to iterate over a sequence.
0:16
Let's save and run and
see what this prints out.
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up