Question:What do you mean by local and global variable?
Answer
Global variable: A global variable, as the name implies, has global scope and is defined in the entire script.
Local variable: Local variables are local to the functions in which they are defined.