Data Structures · Lesson 37 of 76
Dictionaries
A dictionary stores key → value pairs — perfect for describing one thing:
Python
Loop over the pairs:
Python
Your turn: build a dictionary describing yourself with name, age, and town.
Check your understanding
Exercise — check your understanding
Build a dictionary student with keys name, age, and town describing anyone (age should be a whole number).
You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →