Python Practice › List Programs › Program 41
At least one common member
Write a Python program that returns True if two lists have at least one common member.
Input
["a", "b"] and ["c", "b"]
Output
True
Approach
any(x in b for x in a).
Solution
a, b = ["a", "b"], ["c", "b"]print(any(x in b for x in a))Output
True
Learn the concept
New to this topic? Read the lesson, then come back.