Connect with one of the following accounts


Please wait while we redirect...

Views: 84   

Following program shows you how to print factorial of given number.
In this program we get number from user and prints factorial of that number using for loop

number = int(input("Enter a number:"))
result = 1
for i in range(1, number + 1):
    result = result * i
print(number, " factorial is: ", result)


Enter a number: 8
8  factorial is:  40320

On By

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News