DEV Community

Reshma
Reshma

Posted on

Factorial of a number using iteration

n = 12
fact = 1
for i in range(1, n + 1):
    fact *= i

print(fact)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)