Introduction to Scope in Python: Python Basics

preview_player
Показать описание
On your Python journey, you’ve probably learned about functions and loops. To fully understand functions and loops in Python, you need to be familiar with the issue of scope.

This is a portion of the complete course, which you can find here:

The rest of the course covers how to:
- Inspecting the Built-in Scope
- Using the global statement
- Preventing common pitfalls
Рекомендации по теме
Комментарии
Автор

c'mon. Where's the RealPython preciseness?
Global scope means module scope. Each module has it's own "global" scope.
"There's only one global Python scope per program execution" is very wrong.
RealPython website also tells a misleading statement: "Global scope: The names that you define in this scope are available to all your code."
But "all your code" can be or should be across multiple modules.

sausix