This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
DSA/fibonacci.py
2019-02-19 13:23:03 +01:00

20 lines
294 B
Python
Executable file

#!/usr/bin/env python3
import sys
def F(n):
a = 0
b = 1
while n > 0:
c = a
a = a + b
b = c
n = n - 1
return a
def main():
for arg in sys.argv[1:]:
print("F(" + arg + "): " + str(F(int(arg))))
if __name__ == "__main__":
main()