#calculate factorial by multiplying 1 by 2, 
#then by 3, then by 4, then,....
def fact(v):
  i=1
  for j in range(v):
    i=i*(j+1)
  return(i)
x=int(input("type in a number\n"))
print 'factorial of ',x,' is ',fact(x)

