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

21 lines
294 B
Python
Raw Normal View History

2019-02-19 12:23:03 +00:00
#!/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()