I can understand that it is a bit confusing. Remember that the value of a yield expression is what gets passed into next.

The first value comes from `yield x` and x was passed in as 1.
The first value comes from `yield x + 1` and x was passed in as 1.
Then a gets assigned with what we passed into `next()`. `1 + 2` and that is the final value of the generator.