Global Variables in Python: The variables that are declared outside the function are called global variables. These variables can be accessed or invoked by any function in the program.
def v() :
g = "welcome to madanswer"
Welcome to madanswer
Local Variables in Python: The variables that are declared inside a function are called local variables. These type of variables can be accessed only inside the function.