variable declare inside function known as local variable and outside the function is known as global variable
A variable declared inside the function's body or in the local scope is known as local variable. Nonlocal variable are used in nested function whose local scope is not defined. This means, the variable can be neither in the local nor the global scope.
Global variables are the one that are defined and declared outside a function and we need to use them inside a function.