Global variables are the one that is defined and declared outside a function and we need to use them inside a function. This means that a global variable can be accessed inside or outside of the function.
a = "Hello World!!" def func_1(): print(a) func_1()
Output: Hello World!!
Local variables are declared inside the function's body or in the local scope is known as a local variable.
def func_1(): a = "Hello!!" print(a) func_1()