>A Byte of Python

List Comprehensions

List comprehensions are used to derive a new list from an existing list. For example, you have a list of numbers and you want to get a corresponding list with all the numbers multiplied by 2 but only when the number itself is more than 2, then list comprehensions are ideal for such situations.