python check if two lists intersect

Do you want to know the information about “python check if two lists intersect”. If yes, you’re in the correct tutorial.

python check if two lists intersect

a = [1, 2, 3]
b = [3, 4, 5]

bool(set(a) & set(b))

Final Words

I hope this post helps you to know about “python check if two lists intersect”. If you have any questions regarding this article please let us know via the comment section. Share this tutorial with your friends & family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment