Answer
See explanation
Work Step by Step
Local variables are variables which can be accessed only in local scope for example the variables created inside functions can only be accessed inside the function.
Global variables are variables which have global scope and can be accessed anywhere in the code.