Advanced

Python List Comprehension: What it is, how it works, and examples

Posted by eriky on
Python Land; By Erik van Baaren
Mail this story
Print this story

In mathematics, there’s a concept called set-builder notation, also called set comprehension. Inspired by this principle, Python offers comprehensions, too. In fact, the Python list comprehension is a defining feature of the language. This article tells you how they work, including example code and advanced concepts, like nested list comprehensions.

Full Story

  Nav
» Read more about:

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

This topic does not have any threads posted yet!

You cannot post until you login.