Below is the code I have done following a tutorial, it involves creating a generator that makes the Fibonacci sequence, and then prints it out for values under 100. My problem that I have is I don't understand why I am using 'yield a' and what this does. Code is below:
def fib(): a = 0 b = 1 while True: yield a a = b b = a + b for f in fib(): if f > 100: break print(f)