I am trying to write a query that can return me the list items if they contain words from other list.
Words = [ ‘fuel’ , ‘regular’ , ‘clause’ , ‘maximum’ ]
KP = [ ‘ fuel surcharge policy ‘ , ‘Rsp’ , ‘ liability clause’ , ‘Volume’ ]
Output = [ ‘ fuel surcharge‘ , liability clause’ ]
The above output am expecting because it contains ‘fuel’ and ‘clause’ from the first list.
Am using the code below, but am getting NA as output.
Output = []
for i,j in zip (Words, KP):
if i in j:
Output.append (j)
else:
print ('NA")