In Python what is a global statement?

后端 未结 5 1450
情书的邮戳
情书的邮戳 2020-11-28 09:36

What is a global statement? And how is it used? I have read Python\'s official definition;
however, it doesn\'t make a lot of sense to me.

5条回答
  •  猫巷女王i
    2020-11-28 09:37

    Basically it tells the interpreter that the variable its given should be modified or assigned at the global level, rather than the default local level.

提交回复
热议问题