I have 2 lists as below
list1 = ['A']
list2 = ['A1', 'A23', 'B', 'B34']
I want to get return A1 and A2
from list2
because they contain the element in list1
i.e. A.
I tried below
set(list1) & set(list2)
It returns empty set because it is looking for exact match.
What is the way to get partial match which I want?