I'm trying to learn Python with the help of Project Euler.
I'm having a bit of trouble with this piece of code (For Problem 2) and what exactly a 'Non type' is. I was wondering if anyone could help point me in the right direction!
from math import sqrt
x= 0
def f(n):
return ((1+sqrt(5))**n-(1-sqrt(5))**n)/(2**n*sqrt(5))
def SubFib(startNumber, endNumber):
n = 0
cur = f(n)
while cur <= endNumber:
if startNumber <= cur:
print (cur)
n += 1
cur = f(n)
for i in range(SubFib(1,4000000)):
if i % 2 ==0:
x = i+ x
Thank-You in Advance!
NoneTypenext issue isRuntimeError: maximum recursion depth exceededas a result ofSubFib(1,4000000). Does it always need to be this high a value?