import sys def fib_generator(): a,b = 0,1 while True: yield a a,b = b, a+b fibo = fib_generator() for _ in range(int(sys.argv[1])): print(next(fibo))