List Comprehension in Python

Introduction to List Comprehension

Sadrach Pierre, Ph.D.
Towards Data Science
4 min readMay 10, 2020

--

Python provides list comprehension constructs that make it easy to define lists, filter lists, create new lists based on existing lists and much more. Compared to traditional ‘for-loops’, list comprehension is a much more concise and readable alternative to creating lists in python. In this post, we will discuss how to use list comprehension to create lists…

--

--

Writer for Built In & Towards Data Science. Cornell University Ph. D. in Chemical Physics.