Project Euler #2
public python v1 · immutable# simple recursive function with memoizationn1, n2 = 0, 1total = 0while n2 < 4000000: print(n2) n1, n2 = n2, n1 + n2 if n2 % 2 == 0: total += n2 print('Sum: ', total)# simple recursive function with memoizationn1, n2 = 0, 1total = 0while n2 < 4000000: print(n2) n1, n2 = n2, n1 + n2 if n2 % 2 == 0: total += n2 print('Sum: ', total)