Membership of multiple items to a list

I

inkhorn

Dear all,

I'd like to know how to elegantly check a list for the membership of
any of its items to another list. Not caring for elegance, I would
use the following code:

blah = [1,2,3]
yadda = [3,4,5,6]

blah[0] or blah[1] or blah[2] in yadda

Please tell me how to change the preceding code into something nicer
where I don't have to keep extending the line based on the length of
the first list.

Cheers,
Matt Dubins
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top