Consistency formatting
This commit is contained in:
parent
c793c7e9dd
commit
5c7cec373c
@ -20,8 +20,8 @@ def compute():
|
|||||||
|
|
||||||
Find the sum of all the multiples of 3 or 5 below 1000.
|
Find the sum of all the multiples of 3 or 5 below 1000.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0))
|
ans = sum(x for x in range(1000) if (x % 3 == 0 or x % 5 == 0))
|
||||||
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ def compute():
|
|||||||
limit = 4_000_000
|
limit = 4_000_000
|
||||||
x, y = 1, 1
|
x, y = 1, 1
|
||||||
z = x + y # Because every third Fibonacci number is even
|
z = x + y # Because every third Fibonacci number is even
|
||||||
|
|
||||||
while z <= limit:
|
while z <= limit:
|
||||||
ans += z
|
ans += z
|
||||||
x = y + z
|
x = y + z
|
||||||
y = z + x
|
y = z + x
|
||||||
z = x + y
|
z = x + y
|
||||||
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user