Python 101 : Dictionaries - keys with multiple values -


 A dictionary usually maps a key to one value.

Sometimes, we need a key to be linked to multiple values. We could do that using lists as you can see below - Table has three values, Closet has two values -:


We could also add other values red, blue - to the above keys, using the append() method as below:

Comments

Leave as a comment:

Archive