The variables you define in your Python code has a lexical scope where they are valid. These scopes are categorized as local, enclosing, global and built-in scopes.
Python language also provides a few keywords like global and nonlocal to modify the behaviour of its variable name resolution.
This video tries to explain how scopes and namespaces work in different scenarios.
How variables work in Python: • How variables work in Python | Explained w...
Credits: The contents of this video are mostly from my notes on Dr. Fred Baptiste's course https://www.udemy.com/course/python-3...
Auf dieser Seite können Sie das Online-Video Python tutorial: Variable Scopes & Namespaces - global/local/nonlocal | Explained with animations mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sreekanth 08 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 28,105 Mal angesehen und es wurde von 849 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!