Ad

As PEP 20 says, “Readability counts”.

Code
Diff
  • def find_multiples(n): 
        return sum(0 if i % 4 and i % 6 else i for i in range(n))
    • def find_multiples(n): return sum([i, 0][all([i % 4, i % 6])] for i in range(n))
    • def find_multiples(n):
    • return sum(0 if i % 4 and i % 6 else i for i in range(n))