def fibonacci(n): if n
23-03-2024
def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n - 1) + fibonacci(n - 2)
terms = int(input("Enter the number of terms: ")) print("Fibonacci sequence:")
for i in range(terms):
print(fibonacci(i))
Copyrights © 2024 letsupdateskills All rights reserved