I need to make a program that asks for the amount of Fibonacci numbers printed and then prints them like 0, 1, 1, 2... but I can\'t get it to work. My code looks the followi
It looks like you are using the a twice. Try changing that to a different variable name.
a
The following seems to be working great for me.
def fib(): a, b = 0, 1 while True: yield a a, b = b, a+b f = fib() for x in range(100): print(f.next())