...

/

Removing Noise With Yield

Removing Noise With Yield

Learn about the yield keyword and how you can use it to remove noise.

Introduction

Let’s put the role of the iterator method, introduced in the previous lesson into words. As the caller iterated over the object, the iterator yielded the next value. To achieve that, we wrote quite a bit of code. We can get rid of most of the extraneous code using the special yield keyword.

Using yield

The ...