This commit is contained in:
t3xhno 2024-02-06 14:34:24 +01:00
parent 993c2ea7bf
commit 7d5737c68a
4 changed files with 21 additions and 1 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
import sys import sys
sys.path.append("lib") sys.path.append("lib")
from num_functions import isDivBy from num_fns import isDivBy
sum = 0 sum = 0

20
src/problem2.py Normal file
View File

@ -0,0 +1,20 @@
import sys
sys.path.append("lib")
from num_fns import isDivBy
def fib(i):
if i == 1:
return 1
elif i == 2:
return 2
return fib(i - 1) + fib(i - 2)
sum = 0
for i in range(1, 1000000):
curr = fib(i)
if curr > 4000000:
break
if isDivBy(curr, 2): sum += curr
print(sum)