fork download
  1. # your code goes here
  2. def factorial(n):
  3. if(n==1):
  4. return 1
  5. else:
  6. return n*factorial(n-1)
  7.  
  8. for i in range(1,10):
  9. print(factorial(i),end=' ')
Success #stdin #stdout 0.04s 9368KB
stdin
Standard input is empty
stdout
1 2 6 24 120 720 5040 40320 362880