I’m looking for a python 2.7 data structure equivalent to a dictionary but where I can associate more than 1 key.
For example I want to associate:
- cars:
-Chevrolet
-Toyota
-hummer
-Ferrari - computer:
-mac
-windows
-linux
-amstrad
I need to be able to search in the dictionary for the string ‘cars’ or ‘computers’ or others using something like myDictionary.has('cars')
and loop through all the keys corresponding to cars using for key in myDictionary:
Are you looking for a dictionary mapping strings to lists?