I know this maybe easy but I need help with creating a fibonacci sequence array from a to b.
This is my code so far:
def FibL(a,b):
list = []
if a == 0:
return 0
elif a == 1:
return 1
else:
return FibL(a-1) + (a-2)
for i in range(a, b+1):
list.append(i)
return list
When I test it with print(FibL(1,6)), it returns 1.
I need it to return [1, 1, 2, 3, 5, 8]