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