FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 18   



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)

Output:

Enter a number: 8
8  factorial is:  40320



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News