Solution Review: Generator for Fibonacci Numbers
Have a look at how to create a generator for Fibonacci numbers.
We'll cover the following...
We'll cover the following...
Implementation
Explanation
We implement our fibonacci generator by using a yield statement in the function.
We start by defining two local variables, c and n. They are initialized to the first two elements of the Fibonacci series, i.e., 0 and 1, respectively. c stores the current element in the sequence that should be ...