The Python Tutorial

Comprehensive Python documentation.

Chapter 2: Memory-Efficient Generators

Compute items lazily using yield to optimize memory consumption.

stream = (x * x for x in range(1000000))
โ† Chapter 1 Chapter 3: OOP โ†’