Robots Atlas>ROBOTS ATLAS

Python โ€” From Basics to Advanced ยท Data Collections

List Comprehensions

Data Collections

Introduction

List comprehension is a concise syntax for building lists from other iterables. It replaces a multi-line for loop with a single expression. Variants exist for dicts, sets and generators. In this lesson you learn to read and write them.