Use generators to create iterators that can be used in foreach loops. Generators are memory-efficient, as they only generate values when needed, unlike arrays, which are stored in memory.
foreach