List Comprehensions

List comprehension: an old method

An essential part of Python is list comprehension. This will come up repeatedly in examples seen online, so we’re learning about them separately. List comprehension is technically not a part of NumPy, but we’ll introduce it here for a supplementary explanation of the lesson.

The following was the old standard for list comprehensions. Let’s look at the code and then we’ll discuss it in detail.

Get hands-on with 1200+ tech skills courses.