Python

Generators – Python Like a Pro #11

The generator looks similar to a function on paper, but has a few qualities that make it stand out, and ultimately more useful to a programmer in certain scenarios. A generator does not return, rather yields, its data one piece at a time. When the generator is called again, it resumes from the yield statement to yield the next piece of data of object. This means generators are the perfect way to get a large amount of data in a fast and memory-efficient manner, especially when working with an infinite set.

Check out my book, “Building Smart LEGO MINDSTORMS EV3 Robots,” available on Amazon: https://amzn.to/2MyGVCl

My Patreon supporters for more than $5 for the month of September were: Louson and Jeffrey Jahja. Thank you very much!

My supporters on Patreon contribute additional funding that allow me to build up and improve this channel and to make more videos. If you would like to help, you can support me here: https://www.patreon.com/builderdude35

Special thanks to my friend Preston Nichols for designing Builderdude35’s introduction and logo!