Home / Python Tips Generated By ChatGPT / The global Keyword in Python Declare variables inside functions as global to modify the global scope. Source Code x = 5 def change_global_x(): global x x = 10 change_global_x() print(x) # 10