I have a list:
l = [[\'en\', 60, \'command\'],[\'sq\', 34, \'komand\']]
I want to search for komand or sq and get
komand
sq
Yes:
has_oneof = lambda *patterns: lambda: values any(p in values for p in patterns) result = itertools.ifilter(has_oneof('komand', 'sq'), l).next() print result # prints ['sq', 34, 'komand']