OpenSource For You

Passing values to generators and yield

-

The following example shows the passing of a value to a generator function, just like any other function. It also illustrate­s the passing of the value from the next() method. This allows the passing of values between generator and controllin­g code.

Newspapers in English

Newspapers from India