How does return statement with recursion calls hold intermediate values in Python?

后端 未结 2 369
鱼传尺愫
鱼传尺愫 2021-01-15 08:41

Was reviewing some python code related to recursion calls and noticed the return statement looked interesting. How does the recursion work when there is no variable assignm

2条回答
  •  感动是毒
    2021-01-15 08:51

    As explained by AChampion if you want to see the same kind of stack trace for your code in Pycharm do few steps .

    In Pycharm select

    Then you can see while debugging each step how the call stack is added and once the operation is done how the values are returned

提交回复
热议问题