[Tutor] searching for a string in a dictionary

John Fouhy john at fouhy.net
Wed Aug 9 10:14:51 CEST 2006


On 09/08/06, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> But type is still not accessible as an attribute.
> It looked to me like he wanted a list of dictionaries
> in which case it wouyld be:
>
> if teststring in [s['type'] for s in all_types]

Err, that is what I meant :-)

-- 
John.


More information about the Tutor mailing list