Season 2: The Python Team · Episode 7 of 8
You play: AI Engineering Trainee
Episodes run on a tablet or larger screen.
The monthly creator export report reads the entire export into a list, builds three more lists from it, and only then starts summarising. On a big month it runs the workstation out of memory before printing a single line.
Amara Okafor
ML and Data Engineer
Kabelo Mokoena
Platform and DevOps Engineer
You streamed the supplied export through a generator, counted during iteration and used a file context manager for cleanup on normal and exceptional block exit. Initialising the footer state handles an empty export. Total memory still depends on row size, retained state and I/O buffers.