Following is a program to display the Fibonacci sequence for n terms where the value of ‘n’ is entered by the user
<code data-enlighter-language="python" class="EnlighterJSRAW">n = int(input("Enter the number of terms of fibonacci series: "))
temp = 0
fterm = 0
sterm = 1
i=0
print(fterm)
for i in range (0,n-1):
temp = sterm
sterm = fterm + sterm
fterm = temp
print(sterm)
Output – 0 1 1 2 3 5 8 ….. n terms

