Introduction
List comprehension helps you create new lists quickly and clearly by writing a simple expression instead of a longer loop.
When you want to make a new list by changing each item in an existing list.
When you want to pick only certain items from a list based on a rule.
When you want to write shorter and easier-to-read code instead of using loops.
When you want to do simple math or operations on each item in a list.
When you want to create a list from another list in one line.