#----------------------------------------------------------------------- # fibonacci.py #----------------------------------------------------------------------- import stdio import sys # Accept integer n as a command-line argument. Write to standard # output the first n Fibonacci numbers. n = int(sys.argv[1]) f = 0 g = 1 for i in range(0, n): f = f + g g = f - g stdio.writeln(f) #----------------------------------------------------------------------- # python fibonacci.py 16 # 1 # 1 # 2 # 3 # 5 # 8 # 13 # 21 # 34 # 55 # 89 # 144 # 233 # 377 # 610 # 987