In Python, a variable declared outside of the function or in global scope is known as global variable. This means, global variable can be accessed inside or outside of the function.
x = "global"
def foo():
print("x inside :", x)
foo()
print("x outside:", x)
output:
x inside : global
x outside: global