Write a Python function that takes two lists and returns True if they have at least one common member

def func(lst1, lst2):
    for item in lst1:
        if item in lst2:
            return True


list1 = [1, 2, 5, 9]
list2 = [3, 8, 4, 9]

#driver code
print(func(list1, list2))


Follow on:
  • Twitter
  • Facebook
  • Instagram
  • Linkedin
  • Linkedin
Sunil Shaw

Sunil Shaw

  • Youtube
  • Instagram
  • Twitter
  • Facebook
About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page