[Tutor] dictionaries help

davidwilson at Safe-mail.net davidwilson at Safe-mail.net
Thu Jul 23 17:55:11 CEST 2009


hello,
please excuse me, but i would like to understand how dictionaris work.

for example:
>>> my_lst = [{'code': 'aaa', 'name': 'a name'}, {'code': 'bbb', 'name': 'b name'}]
>>> my_code = 'aaa'


from the above i would like to compare my_code and return the dictionary which has code == my_code

dave


More information about the Tutor mailing list