Python

Python

Made by DeepSource

Consider using all PY-W0075

Anti-pattern
Major
Autofix

It is recommended to use all for this loop, as it will make your code smaller and more readable.

Bad practice

def all_even(items):
    for item in items:
        if item % 2 != 0:
            return False
    return True

Recommended

def all_even(items):
    return all(item % 2 == 0 for item in items)