Python g lobal သော့ချက်စာလုံး
ဥပမာ
လုပ်ဆောင်ချက်တစ်ခုအတွင်းတွင် ကမ္ဘာလုံးဆိုင်ရာပြောင်းလဲမှုတစ်ခုကို ကြေညာပြီး လုပ်ဆောင်ချက်ပြင်ပတွင် အသုံးပြုပါ-
#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)
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
global
သော့ချက်စကားလုံးကို လုပ်ဆောင်ချက်တစ်ခုအတွင်း၊ ကမ္ဘာလုံးဆိုင်ရာ နယ်ပယ်တစ်ခုမှ ကမ္ဘာလုံးဆိုင်ရာ ကိန်းရှင်များကို ဖန်တီးရန် အသုံးပြုသည် ။