Factoral


#1

okay, I'm a bit lost. I tried doing something like this:

def factoral(x):
    listy = []
    for y in range(x):
        if x % y == 0:
            listy.append(y)
        return listy

and got: "Oops, try again. Did you define a function called factorial?" which isn't all that useful for debugging.

Can anyone help me figure out what I'm doing wrong?


#2

There is a error in function name i.e factoral

you can try this code
def factorial(x):
list=[]
f=1
while x>0:
list.append(x)
x -=1
for fact in list:
f *= fact
return f