Skip to main content
Intermediatehow it works

What are generators, and why do they matter for big data?

Source: Python tutorial: data structures

Quick answerFree

A generator function uses yield to produce values one at a time and pauses between them, so only the current item is in memory. Chaining generators (read → filter → batch → load) processes a file of any size with constant memory.

Detailed answer· 67 words

Interview Prep

Unlock the full answer with Interview Prep

Get a 67-word model answer, 4 key points and a visual explainer, plus 233 more Python questions.

Also in Pro (₹499 / 90 days).

Key points· 4 points

Interview Prep
Unlock with Interview Prep

Visual explainer· animated, step by step

Interview Prep
Unlock with Interview Prep

+ 233 more Python questions in Interview Prep, each with the full answer.

Discussion