Thursday, January 26, 2017

Factorial of a Number Python

Tags

Following Code will Calculate the factorial of a number :

Code::

fact=1
i=input("Enter Any Number:")
for j in (range(1,i+1)):                #range function for iteration from 1 to i+1
 fact=fact*j

print(fact)



Note:   Take care of the space in the code which leads to formation of blocks

Output: