17. Problem to print true if common elements between lists.  

We will take two lists as input & iterate all the values one by one with the python loop with the help of the below-given steps. Print True if there are any common elements between lists.

Common elements between lists:

Steps to solve the program
  1. Take two lists as input.
  2. Use a for loop to iterate over elements in the first list.
  3. Using an If statement check whether an element exists in both lists or not.
  4. If yes print True.

Output :

Related Articles

Copy the list to another list

removing certain elements from a list

Leave a Comment