I have two list :
list_1 = ['rwww corp\pan 2323 2018-23-23 0% c:\program files\pa.txt', 'rwww corp\pand 2323 2018-23-23 0% c:\program files\monkey.txt']
list_2 = ['c:\program files\pa.txt']
I would like to find if list_2 element is there in list_1, if yes, then print that.
In this case, list_2 element is at index 0 for list_1, how can i use one liner to achieve this?
I have a boring way of doing this by using two for-loops:
for e in list_1:
for k in list_2:
if k in e:
print e