I am learning list comprehension and I am not able to understand, why the outputs are different in case of list comprehension and equivalent for loop.

List Comprehension:

```
>>> [b for b in range(0,a) for a in range(1,5)]
[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]

```

equivalent for loop:

```
>>> list = []
>>> for a in range(1,5):
...     for b in range(0,a):
...         list.append(b)
...
>>> list
[0, 0, 1, 0, 1, 2, 0, 1, 2, 3]

```

Please help me to understand why are they giving different output and what is correct way to read the list comprehension.