summaryrefslogtreecommitdiff
path: root/doc/data/messages/c/consider-using-any-or-all/good.py
blob: 5acf18e74565a1f270dad9b209dd18c90d0d3f22 (plain)
1
2
3
4
5
6
7
8

def any_even(items):
    """Return True if the list contains any even numbers"""
    return any(item % 2 == 0 for item in items)

def all_even(items):
    """Return True if the list contains all even numbers"""
    return all(item % 2 == 0 for item in items)