# Python CodeRecipe|globalの使い方
❮ Home ❮ Python Keywords
# globalの例1
Declare a global variable inside a function, and use it outside
the function:
#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の定義及び使い方
global関数は、グローバルを作成するために使用します。 関数内など、グローバルでないスコープの変数。
❮ Home ❮ Python Keywords