fork(1) download
  1.  
  2. fact = (lambda f: f(f))(lambda f: (lambda n: n*f(f)(n-1) if n else 1))
  3.  
  4. for n in range(6):
  5. print(n, fact(n))
Success #stdin #stdout 0.02s 9136KB
stdin
Standard input is empty
stdout
0 1
1 1
2 2
3 6
4 24
5 120