I have found some answers to this question before, but they seem to be obsolete for the current Python versions (or at least they don\'t work for me).
I want to chec
You can import any from __builtin__ in case it was replaced by some other any:
any
__builtin__
>>> from __builtin__ import any as b_any >>> lst = ['yellow', 'orange', 'red'] >>> word = "or" >>> b_any(word in x for x in lst) True
Note that in Python 3 __builtin__ has been renamed to builtins.
builtins