fork download
  1. from math import sqrt
  2.  
  3. def tower(x, n):
  4. if n>1:
  5. return x**tower(x, n-1)
  6. else:
  7. return x
  8.  
  9.  
  10. print tower(sqrt(2), 5), tower(sqrt(2), 10), tower(sqrt(2), 15), tower(sqrt(2), 100)
Success #stdin #stdout 0.01s 7852KB
stdin
Standard input is empty
stdout
1.89271269683 1.9836683993 1.99740700114 2.0