Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Dictionaries Introducing Dictionaries Dictionary Syntax and Key:Value Pairs

Temi Folorunsho
Temi Folorunsho
2,849 Points

Key value pairs

What does it mean for dictionary to have a duplicate key?

1 Answer

Hi Temi Folorunsho

You can think of it like a Websters dictionary. It has all of the letters of the alphabet with all of the words & definitions. The words and definitions would be the values and the A, B, C, etc... would be the keys. Dictionaries only have one of each letter. If it had 2 M*s (duplicates), that would be confusing. But the letters *or keys can store many different words & definitions or values.

dictionary = {"A": ['Airplane', 'Apricot'], "B": ['Book', 'Brain']}

Hopefully that visual helped :)