I have a list:
l = [[\'en\', 60, \'command\'],[\'sq\', 34, \'komand\']]
I want to search for komand or sq and get
If all you're trying to do is return the first list that contains a match for any of the values then this will work.
def search(inlist, matches):
for li in inlist:
for m in matches:
if m in li:
return li
return None
>>> l = [['en', 60, 'command'],['sq', 34, 'komand']]
>>> search(l, ('sq', 'komand'))
['sq', 34, 'komand']