My first code was like this:
def factorial(n): while n > -1: if n > 1: return n*(n-1) elif n==1: return 1 elif n==0: return 1 else: print"something wrong with your code!"
It was only multiplied once : n * (n-1).
But when I changed n*(n-1) to n* factorial (n-1), it worked.
Could anybody tell me why? Thanks !
Replace this line with your code.