Question: I'm trying to build a list of the first ten factorials 

```
[1,1,2,6,24,120,720,5040,40320,362880]

```

using only list comprehension. Is that possible?

I don't know generators or `lambda`.

Here's my attempt, but I absolutely know why it's wrong:

```
lst = [1] + [i for i in range(1,10)]
lst[1:10] = [lst[i-1] * i for i in range(1,10)]
print(lst)

```

Answer: 
Your attempt does not work because the list comprehension works element-wise, you cannot refer to `lst[i-1]` like that. There is a `factorial` function in `math` module, however, since you mentioned generators, you can use one like this

```
def mygenerator():
    total = 1
    current = 1
    while True:
        total *= current
        yield total
        current += 1

factorial = mygenerator()
output = [next(factorial) for i in range(10)]

```
We could also use our own function but hey, the meaning of the comprehension lists is lost a bit but it is still functional

```
def factorialIte(n):
  factorial = 1
  for i in range(1,n+1):
    factorial = factorial*i
return factorial
# 10 is n_max
[factorialIte(n) for n in range(1,11)]
>>[1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]

```