Skip to main content

Practice ยท 1 of 2

Streaming running stats

Implement running_stats(numbers) โ€” a GENERATOR that yields (count, running_total) after consuming each number. Grading probe: the test feeds an infinite-ish source and only pulls the first 5 pairs โ€” a materializing implementation (list(...)) hangs or blows up; a lazy one passes instantly.

Difficulty: advanced

Back to lesson: Practice: Project: Performance Rescue