[Tutor] searching for a string in a dictionary

anil maran anilmrn at yahoo.com
Wed Aug 9 01:48:19 CEST 2006


all_types:
<Storage {'type': 'childcare', 'id': 1, 'created': datetime.datetime(2006, 7, 26, 15, 18, 34, 887436)}>
<Storage {'type': 'household', 'id': 2, 'created': datetime.datetime(2006, 7, 26, 15, 18, 34, 887436)}>
.....
<Storage {'type': 'knews', 'id': 10, 'created': datetime.datetime(2006, 7, 26, 15, 18, 34, 887436)}>
there is such a list

how do i search for a particular string say teststring in this list

i tried

if teststring in all_types:
if teststring in all_types.type: 
it doesnt work


please help me out here
should i use lambda


 		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060808/b36677ca/attachment.htm 


More information about the Tutor mailing list