I'm working on the 'Factorial' exercise, & I'm receiving an error that has me a bit puzzled. When I 'save & submit', the interpreter comes back with "list assignment index out of range". I understand the basic message that it's trying to convey,but is there any way to tell if it's pointing to line 3, line 4, or line 6??
Line 3 - trying to instantiate an empty list.
Line 4 - trying to populate the 1st item in that list with the value of 'x'
Line 6 - trying to populate the remainder of the list with each number from 'x - 1' to 1.
I'd appreciate any clarification that could be provided. Thanks.
factorial(1) resulted in an error: list assignment index out of range
def factorial(x): total = 0 numlist =  numlist = x while x >= 2: numlist.append(x) x -= 1 for i in numlist: total = total + i return total