Generators are a type of function that allow you to iterate through a sequence of values, one at a time. They are different from regular functions because they use the yield keyword instead of return to return a generator object. We can create a generator that produces the fibonacci sequence by using the yield keyword to return each number in the sequence as it is generated.
Example