✓ Accepted answer
Local variables are confined to the scope they were defined in. If a variable is defined in the global scope, it doesn't make any difference whether or not the variable is local or global. var = 5 and local var = 5 are the same if in the global scope. Actually, there is a small difference between the two in that accessing local variables is slightly faster then accessing global variables. In general, it is better to use local variables rather than global variables.
A do statement does not make any real performance impact and is used in order to make certain variables private and have a finer control over the scope of variables.
1 comment
What he said. Xd