Python (code implemented using the Fibonacci sequence recursive function)
If you execute the above code, the return value becomes fib(5)+fib(4) after 6 is assigned to n because of print(fib(6)), and then how is 5 assigned to n?
Below is a list of what I think is the execution process. If there is any mistake, please correct it.python
That's roughly right.
To be more clear, you can leave a logging and check it. This is the logging code created by the decorator below, and it is the result.
© 2022 pinfo. All rights reserved.