Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/scenarios/test-cli/wkspc1/demo.py
13401 views
1
# Copyright (c) Microsoft Corporation and GitHub. All rights reserved.
2
3
# Program to display the Fibonacci sequence up to n-th term
4
def 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
20
printFibb(34);
21