1# Copyright (c) Microsoft Corporation and GitHub. All rights reserved. 2 3# Program to display the Fibonacci sequence up to n-th term 4def printFibb(nterms): 5 # first two terms 6 n1, n2 = 0, 1 7 count = 0 8 print("Fibonacci sequence upto",nterms,":") 9 print(n1) 10 # generate fibonacci sequence 11 print("Fibonacci sequence:") 12 while count < nterms: 13 print(n1) 14 nth = n1 + n2 15 # update values 16 n1 = n2 17 n2 = nth 18 count += 1 19 20printFibb(34); 21