Introduction
Generators let you create lists step-by-step without using much memory. Sometimes, you want to send back a final result when the generator finishes.
When you want to process large data one piece at a time but also get a final summary.
When you need to pause and resume a function but still return a final value at the end.
When you want to save memory by generating items on demand and also return a result after all items are done.