Generators provide a much nicer syntax for performing iteration. A generator function automatically returns a special generator object. The generator object has a next method just like the custom iterator method we wrote. Except, now we can simply use the yield keyword to pass control to the caller. In this video we'll rewrite our custom iterator method to use generators instead.
One-On-One Questions or Comments?
Something not making sense, want to share your thoughts or just say hello? I check this daily!