主页
Python
Python global 关键词
demo_ref_keyword_global
运行 ❯
×
更改方向
保存代码
更改主题
#create a function: def myfunction(): global x x = "hello" #execute the function: myfunction() #x should now be global, and accessible in the global scope. print(x)
hello