Python Factorial Code


SUBMITTED BY: kaushal1981

DATE: Feb. 16, 2017, 6:17 p.m.

FORMAT: Text only

SIZE: 210 Bytes

HITS: 1300

  1. print ': Factorial:\n'
  2. def Factorial():
  3. n = input ('Enter the number to find factorial: ')
  4. fact=1
  5. for i in range(1,n+1):
  6. fact=fact*i
  7. print('Factorial of a number %d is %d'%(n,fact))

comments powered by Disqus