dear group:

I have a dictionary object that looks like this:



xdic
{11135457: [1], 11135492: [1], 11135913: [1], 11135436: [1, 2], 11135699: [1, 
2], 11135702: [1, 3], 11135901: [1]}


I want to print only those items that have [1,2] and [1,3]  in any order, such 
as [1,2] or [2,1], [3,1] or [1,3]


>>> for item in xdic.keys():
...     if [1,2] in xdic[item]:
...             print item


I get a wrong answer, I know the values are there. How can I print only those 
item that have [1,2] and [1,3]

Thank you. 
h


      
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to