Python, Programming, Experiment, Data Structures.
only 80 bytes, whereas the list takes over 80Mb. The Generator also loaded a lot faster, though we’re talking about a couple of seconds here. It becomes clear then that, in any problem where memory could be scarce, replacing Lists with Generators may be a smart choice, as long as we keep the