Send

This lesson discusses sending values to a generator function.

We'll cover the following...

Send

In the previous section, we formally introduced generators. Interestingly, we can also pass data to a generator function using the send() method defined on the associated generator object. The generator function can receive the value using the following syntax:

    item = yield

The send() method can also return a value to ...