i wrote this python code in python3.
def fibonacci(n): #generator function
a, b, counter = 0, 1, 0
while True:
if (counter > n):
return
yield a
a, b = b, a + b
counter += 1
f = fibonacci(5) #f is iterator object
in the above code if i replace the return with the "break" statement, then it still work fine.
I am looking for more clarification on the usage of "Return" vs "Break" from this particular code perspective.