Python Global Namespace

preview_player
Показать описание
In this video tutorial I continue to consider Python namespaces with an emphasis on the Global Namespace.

Рекомендации по теме
Комментарии
Автор

Dear Sir, Thank you for your hard work and your time so that those of us who are not able can get an education.
My short question is whether Type Namespace and Variable Scope (LEGB) are the same since local namespace behaved the same as the local variable and also applies to global and Bilt-in.
Of course, the only difference is that with Type Namespace we have Local, Global and Bilt-in Namespace and with Variable Scope we have Local, Enscoling, Global and Bilt-in scope.
So to conclude, can I understand, for example, Global Namespace as a Global Variable scope?
Thank you very much in advance.

mikijasar
Автор

Urm I thought you were going to show something like this:
def urm():
global z
x = 12
print(x + z)

z = 6
print(z)
urm()
runtime gives:
6
18

SusanAmberBruce