Published on January 26, 2024By DeveloperBreeze
def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n-1) + fibonacci(n-2)
result = [fibonacci(i) for i in range(10)]
print('Fibonacci Sequence:', result)
def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n-1) + fibonacci(n-2)
result = [fibonacci(i) for i in range(10)]
print('Fibonacci Sequence:', result)
Comments
Please log in to leave a comment.