Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Created December 26, 2022 11:58
Show Gist options
  • Save hamaguchi-amago/56d6201a4a6c63066e9e54f9f809cceb to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/56d6201a4a6c63066e9e54f9f809cceb to your computer and use it in GitHub Desktop.
MAX_TIME = 10
def main():
# グローバル変数
global MAX_TIME
print(MAX_TIME)
# 書き換えられてしまう
MAX_TIME = 20
print(MAX_TIME)
if __name__ == '__main__':
main()
@hamaguchi-amago
Copy link
Author

ブログで作成しました。

【Python】プログラム中に定数を扱う注意点
https://neko-py.com/python-constants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment