aboutsummaryrefslogtreecommitdiffstats
path: root/test1.py
diff options
context:
space:
mode:
Diffstat (limited to 'test1.py')
-rw-r--r--test1.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test1.py b/test1.py
new file mode 100644
index 0000000..db3f188
--- /dev/null
+++ b/test1.py
@@ -0,0 +1,16 @@
+def fib(*arg):
+ fib1 = [0, 1]
+ if(len(arg) == 1):
+ for x in range(2, arg[0]):
+ fib1.append(fib1[x-2]+fib1[x-1])
+ print(fib1)
+ elif(len(arg) == 2):
+ for x in range(2, arg[1]):
+ fib1.append(fib1[x-2]+fib1[x-1])
+ print(fib1[arg[0]-1:])
+
+def main():
+ fib(10, 20)
+
+if __name__ == '__main__':
+ main() \ No newline at end of file