The -th iterated application of a single-argument function is the function that, applied to value , returns , that is, , where is applied times. Zero applications of correspond to the identity function (as usual, zero repetitions of anything correspond to a neutral element). Write a function that returns the -th iterated application of . The value of will be a non-negative integer, and is expected to take floats to floats.
>>> iterated_appl(lambda x: x*x, 3)(2) 256.0 >>> sqr = lambda x: x*x >>> iterated_appl(sqr, 2)(3) 81.0 >>> iterated_appl(sqr, 0)(2) 2.0 >>> add_1 = lambda x: 1+x >>> iterated_appl(add_1, 5)(3.1) 8.1 >>> iterated_appl(iterated_appl(add_1, 5), 2)(2) 12.0