A global variable (DEF) is a variable which is accessible in multiple scopes. It is important to note that global variables are only accessible after they have been declared. That is, you can use a variable is is declared below its usage in the text. For instance, if we consider this simple program, we have one global variable, w.