Oops, try again. factorial(2) returned 0 instead of 2
Trying to understand the logic. Can anyone help? I want to really understand what I'm doing wrong here.
def factorial(x): if x == 1 or x == 0: return 1 total= 0 for n in range(x+1): total *= n return total