0
Explain answer please (262144)
def f(x): if x<=1: return 1 else: x=x**f(x-1) return x print(f(4))
2 Réponses
+ 1
** means exponent, so you are doing a recursion with bases, until the exponent number is 1 and summing all the results
0
f(1) =1
f(2) = 2**f(1) = 2**1 = 2
f(3) = 3**f(2) = 3**2 = 9
f(4) = 4**f(3) = 4**9 = 262144