Useful way to check if all/any elements of an iterable are true in #Python:
Useful way to check if all/any elements of an iterable are true in #Python:
>>> languages = ['Java', 'Perl', 'PHP', 'Python', 'JS', 'C++', 'JS', 'Ruby']
>>> all(len(l) >= 2 for l in languages)
True
>>> any('++' in l for l in languages)
True