Code :
num = int(input("Enter any number: "))
fact = 1
for i in range(1,num + 1):
fact = fact * i
print("Factorial result is: ",fact)
Output :
Enter any number: 8
Factorial result is: 40320
IDE Used To Test This Code : Python IDLE.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.
num = int(input("Enter any number: "))
fact = 1
for i in range(1,num + 1):
fact = fact * i
print("Factorial result is: ",fact)
Enter any number: 8
Factorial result is: 40320
IDE Used To Test This Code : Python IDLE.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.
Post a Comment