0
Why is the value of n (when printing n1:{n} after the r(lst,n-1) becomes 2 and not 1?what happens when the function do return?
def r(lst,n): print(f"nn:{n}") if (n <= 1): return r( lst, n-1) print(f"n1:{n}") r([12,14,13,11,16,10],6)
1 Odpowiedź
+ 3
When the function hits the return, it ends.