[Tutor] python: how do I create a list of definitions?

Tiger12506 keridee at jayco.net
Fri Jul 20 02:35:48 CEST 2007


> I don't understand dict

Think of dict as a dictionary. Literally. You have a word, you look up it's 
definition in the dictionary. A dictionary is made up of key, value pairs. 
So for your example:

a_dict = {2243 : 'e',
               2234 : 'p',
               2235 : 'lol',
               'how' : 'under'}

if x in a_dict:
  string = string + a_dict[x]


JS 



More information about the Tutor mailing list