I agree in that I do not understand how this is working. I did not think that if statements looped without being inside a while or for loop?
The way I read this if x = 8 this will produce 8*7 and that will be the end. What is making loop back to add the 6, 5, 4 etc.?
def factorial(x): if x > 1: result = x*factorial(x-1) else: return x return result
Continuing the discussion from 5 factorial: