###
List Comprehensions in Python

```
# create a new list
```

`>>> a = [1,2,3,4,5]`

```
>>> a
[1, 2, 3, 4, 5]
```

`# sample list comprehension expression; equivalent to b = a`

`>>> b = [a[i] for i in range(len(a))]`

```
>>> b
[1, 2, 3, 4, 5]
```

`# only even indices`

`>>> b = [a[i] for i in range(len(a)) if i % 2 == 0]`

>>> b
[1, 3, 5]

# only even indices and conditionally modifies the value of a[i]
>>> b = [a[i]*2 if i > 1 else a[i] for i in range(len(a)) if i % 2 == 0]
>>> b
[1, 6, 10]