When you call a generator function, it doesn't return a single value; instead it returns a generator object that supports the iterator protocol.On executing the :keyword:`yield` statement, the generator outputs the value of ``i``, similar to a :keyword:`return` statement.The big difference between :keyword:`!yield` and a :keyword:`!return` statement is that on reaching a :keyword:`!yield` the generator's state of execution is suspended and local variables are preserved.On the next call to the generator's ``next()`` method, the function will resume executing immediately after the :keyword:`!yield` statement.(For complicated reasons, the :keyword:`!yield` statement isn't allowed inside the :keyword:`!try` block of a :keyword:`try`...\ :keyword:`finally` statement; read :pep:`255` for a full explanation of the interaction between :keyword:`!yield` and exceptions.)