Sometimes we encounter the problem of checking if one list contains any element of another list. This kind of problems is quite popular in competitive programming. Let’s discuss various ways to achieve this particular task.
Method #1: Using
Method #2: Using in operator.
- Python | Check if two lists have at-least one element common
- Python | Check if element exists in list of lists
- Python | Print all the common elements of two lists
- Python | Count of common elements in the lists
- Python | Find common elements in list of lists
- Python program to find common elements in three lists using sets
- Python | Find most common element in a 2D list
- Python | Merge List with common elements in a List of Lists
- Python | Find most common element in each column in a 2D list
- Python | Concatenate two lists element-wise
- Python - Diagonal element addition among lists
- Python | Remove given element from list of lists
- Python | Merge two list of lists according to first element
- Python | Check if two lists are identical
- Python - How to Check if two lists are reverse equal
- Python | Check whether two lists follow same pattern or not
- Python | Check whether two lists are circularly identical
- Python | Program to count number of lists in a list of lists
- Python | Check if a list exists in given list of lists
- Python | Check element for range occurrence
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.