File "python", line 8, in factorial
TypeError: list indices must be integers, not list
Okay so I get there is an easier way to do this but I want to validate the way I thought about how to do it. I'm calling on the specific values of my list which are integers but it's saying i'm calling on the list. Not sure how to fix it.
def factorial(x): l = [range(1,x+1)] print l count = x t = 1 while count > 0: for n in l: t = l[n] * t count -= 1 else: print t