Created
December 26, 2022 11:58
-
-
Save hamaguchi-amago/56d6201a4a6c63066e9e54f9f809cceb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAX_TIME = 10 | |
def main(): | |
# グローバル変数 | |
global MAX_TIME | |
print(MAX_TIME) | |
# 書き換えられてしまう | |
MAX_TIME = 20 | |
print(MAX_TIME) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ブログで作成しました。
【Python】プログラム中に定数を扱う注意点
https://neko-py.com/python-constants