SMRTR ProgrammingMay 11, 2026Real Python

How to Flatten a List of Lists in Python

SMRTR summary

Use `.extend()` or list comprehensions for simple nested lists. For deeper nesting, use `itertools.chain()`, `functools.reduce()`, recursion, or NumPy's `.flatten()` for data science workflows.

SMRTR provides this summary for quick context. The original article belongs to Real Python.

Read the original article
SMRTR Programming

Get the next batch of curated stories in your inbox.

This archive is built from SMRTR newsletter stories. Subscribe for hand-picked stories without the extra noise.

Related Stories

Browse Programming