[Tutor] dictionaries help

Alan Gauld alan.gauld at btinternet.com
Thu Jul 23 19:04:23 CEST 2009


"Alan Gauld" <alan.gauld at btinternet.com> wrote 

Oops!
Should be:

> def findDict(value, dictList):
>   for dct in dictList:
>       if dct.get('code', '') == my_code

         if dct.get('code', '') == value

>          return dct


> HTH,
> 
> 
> -- 
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/ 
>



More information about the Tutor mailing list