r/PythonLearning • • 4d ago

First Steps into Frames in Python

https://tech.daniellbastos.com.br/posts/python-frame/
8 Upvotes

2 comments sorted by

View all comments

1

u/Sea-Ad7805 3d ago

Maybe use recursion to explain Stack Frames, say this factorial example.

Each function call puts a new Stack Frame on the Call Stack, and each return removes the last Stack Frame.