What am i doing wrong please help me?


#1

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


#2

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

def factorial(x):
total = 1


#3

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


#4

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