Extend a Generator

·

1 min read

def my_generator():
    yield from ('Honda', 'Kawasaki', 'Suzuki', 'Yamaha')

japan_makers = my_generator()

euro_makers = ['Aprilia', ' Ducati']

all_makers = euro_makers.extend(japan_makers)

print(all_makers)

Output:
['Aprilia', ' Ducati', 'Honda', 'Kawasaki', 'Suzuki', 'Yamaha']