Write a program to print the nth fibonacci number


Topic: Write a program to print the nth fibonacci number

Solution

n1 = 1
n2 = 1
n = 5
for _ in range(n):
   n1, n2 = n2, n1 + n2
print(n2)



List all Python Programs