Python list comprehension

Regular:

numbers = [1, 2, 3, 4, 5]
tripled_numbers = [number * 3 for number in numbers]
With conditionals
Example1
:
numbers = [1, 2, 3, 4, 5]
odd_numbers = [number for number in numbers if number % 2 == 1]
Example2:
numbers = [1, 2, 3, 4, 5]
numbers_b_than_3 = [numbers[i] for i in range(len(numbers)) if numbers[i] > 3]