Use of Global Keyword in Python

preview_player
Показать описание
If we try to change the value of a variable inside a function, it will change only for the function and not outside the function. To make global changes in the variable we use the global keyword. Use of the Global keyword will change the value of variable globally and change will be permanent. For this reason, its better to avoid the use of this keyword.
Рекомендации по теме