all
PY-W0075It is recommended to use all
for this loop, as it will make your code smaller and more readable.
def all_even(items):
for item in items:
if item % 2 != 0:
return False
return True
def all_even(items):
return all(item % 2 == 0 for item in items)