What am i doing wrong please help me?


def factorial(x):
total = 1
while x > 0:
total *= x
x -= 1
return total


[quote="byteblaster53849, post:1, topic:63337, full:true"]

def factorial(x):
total = 1


Check your indentation. The while statement is not inside the code block of the function, which renders the return statement invalid.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.