Hi,
>>> l1
['Anushaabcdis', 'bcdef', 'ushaabcdisAn']
>>> l2
['An', 'test']
>>> l3
['ab', 'is']
for ele in l1:
for ele1 in l2:
for ele2 in l3:
f3 = l1.find(ele1)
f4 = l1.find(ele2)
if (f3 < f4):
tl.append(ele)
Is there a better way of checking two substring matching position in a list. Because in my real example l1,l2,l3 are huge and it is taking me computationally exhaustive search not able to handle huge string. can I directly find the matching string position in a list in python??
Thanks,
Anusha
>>> l1
['Anushaabcdis', 'bcdef', 'ushaabcdisAn']
>>> l2
['An', 'test']
>>> l3
['ab', 'is']
for ele in l1:
for ele1 in l2:
for ele2 in l3:
f3 = l1.find(ele1)
f4 = l1.find(ele2)
if (f3 < f4):
tl.append(ele)
Is there a better way of checking two substring matching position in a list. Because in my real example l1,l2,l3 are huge and it is taking me computationally exhaustive search not able to handle huge string. can I directly find the matching string position in a list in python??
Thanks,
Anusha