def fibonacci(num, prev_num, sum=0):
print(num, prev_num, sum)
if num % 2 == 0:
sum += num
if num < 4000000:
return fibonacci(num + prev_num, num, sum)
Uses recursion, can someone explain how to calculate the complexity?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.