filmov
tv
In Python Global keyword is use to change value of global variable locally #shorts

Показать описание
In Python, global keyword allows you to modify the variable outside of the current scope. It is used to create a global variable and make changes to the variable in a local context.
Rules of global Keyword-
The basic rules for global keyword in Python are:
When we create a variable inside a function, it is local by default.
When we define a variable outside of a function, it is global by default. You don't have to use global keyword.
We use global keyword to read and write a global variable inside a function.
Use of global keyword outside a function has no effect.
#shorts #python #youtubeshorts #global #local #legb
Rules of global Keyword-
The basic rules for global keyword in Python are:
When we create a variable inside a function, it is local by default.
When we define a variable outside of a function, it is global by default. You don't have to use global keyword.
We use global keyword to read and write a global variable inside a function.
Use of global keyword outside a function has no effect.
#shorts #python #youtubeshorts #global #local #legb