Global Variable In Python. Let's see an example of how a global variable is created in python. 01:13 but if you want to modify a global variable—and you really shouldn’t want to— you must use the keyword global to declare it as a global variable in your function so python will let you change it.

Create the global variable in python. Global_list = [] the assignment implicitly creates a local variable global_list, so it should be written Global variables are available from within any scope, global and local.