If you were holding your breath, you can let it out now! Congratulations on completing this deep dive into scopes and closures in Python. By using the debugger Thonny, you’ve walked through a code snippet to better understand how scopes and closures work.
In this Code Conversation video course, you:
- Refactored code to use more descriptive names
- Learned about local and nonlocal scopes and how functions access variables
- Understood how scopes open and close through inner and outer function calls
You used your interpreter to dig into Python and inspect dunder objects to find out how Python handles and stores variables.
For more informaton on the concepts covered in this video course, you can check out:
- Martijn Peters on Scopes and Closures: Stack Overflow
- Namespaces and Scope in Python
- Python Scope & the LEGB Rule: Resolving Names in Your Code
- Data Model: Python Documentation
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.