Here's the loop solution: python def factorial(n): result = 1 for i in range(1, n + 1): result = result * i return result Start with (the identity for multiplication).
Multiply by each number from to . For , the loop runs zero times, so result stays . That's correct since .