Membership of multiple items to a list

Paul Rubin http
Sun Feb 1 15:00:51 EST 2009


inkhorn <matt.dubins at sympatico.ca> writes:
> blah = [1,2,3]
> yadda = [3,4,5,6]
> 
> blah[0] or blah[1] or blah[2] in yadda

if set(blah) & set(yadda): print "yes"



More information about the Python-list mailing list