A local variable reference in the function or block in which it is declared overrides the same variable name in the larger scope These models attempt to account for the probabilistic features of quantum mechanics via the mechanism of underlying but inaccessible variables, with the additional requirement that distant events be statistically independent In programming languages with only two levels of visibility, local variables are contrasted with global variables
⏰ B̶U̶N̶N̶Y̶ 🐇 (@ripfez) / Twitter
Each local variable in a function comes into existence only when the function is called, and disappears when the function is exited
Such variables are known as automatic variables
These are variables that are external to a function and can be accessed by name by any function. Automatic variable in computer programming, an automatic variable is a local variable which is allocated and deallocated automatically when program flow enters and leaves the variable's scope The scope is the lexical context, particularly the function or block in which a variable is defined. While the term can refer to global variables, it is primarily used in the context of nested and anonymous functions where some variables can be in neither the local nor the global scope.
These variables are typically stored in the call's activation record on the call stack along with other information such as the return address. The use of local variables — of variable names with limited scope, that only exist within a specific function — helps avoid the risk of a name collision between two identically named variables.