Combining Generators

using the yield method to combine multiple sequences in one iterable

It is possible to combine two sequences in one iterable. All you need to do is use yield* to include an iterable, which will enumerate all of its values one by one.

Yield* delegates iteration to another generator or iterable object.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.