Ad
Code
Diff
  • def find_multiples(n):
        return sum({num for num in range(4, n, 4)} | {num for num in range(6, n, 6)})
    • def find_multiples(n):
    • total = 0
    • for i in range(0, n, 2):
    • if i % 4 == 0 or i % 6 == 0:
    • total += i
    • return total
    • return sum({num for num in range(4, n, 4)} | {num for num in range(6, n, 6)})