We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ccce90 commit 88afcd9Copy full SHA for 88afcd9
1 file changed
experiments/fib_improved.py
@@ -0,0 +1,17 @@
1
+
2
3
+def fib(n):
4
+ a, b = 1, 1
5
+ for i in range(1, n):
6
+ a, b = b, a + b
7
8
+ return a
9
10
11
+def main():
12
+ for i in range(1, 15):
13
+ print("fib({}) is {}".format(i, fib(i)))
14
15
16
+if __name__ == '__main__':
17
+ main()
0 commit comments