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

Temi Folorunsho
Temi Folorunsho
1,544 Points

Key value pairs

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

1 Answer

Mel Rumsey
.a{fill-rule:evenodd;}techdegree seal-36
Mel Rumsey
Treehouse Staff

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 :)