Why I cannot access a global variable in the same block preceding the global keyword?

前端 未结 0 795
情书的邮戳
情书的邮戳 2021-02-06 09:41

So in python, you can always access a global variable anywhere without using global keyword. Like this

my_global_variable = 5

def simple_func():
            


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题