Variable: associates a name with a value
Assignment Statement: variables receive their initial values and can be reset to new values using this
<variable name> = <expression>
The left side will always be the variable name, and the right side will always be the value attributed to it. When this happens to the variable name for the first time, it is called defining or initializing the variable.
Rules for Naming Variables
- A variable name must begin with either a letter or an underscore
- Can contain any number of letters, digits, and underscores
- Case sensitive
- Words that are used for commands, functions and operations cannot be used for variables: if, def, import
- Certain characters reserved for other functions cannot be used: – and +
Norms for Naming Variables
- Using underscores to increase the readability of variables
- Camel Casing: in the case of variable name (except for the first one) with an uppercase letter to increase readability
- Symbolic Constants: variables that will not change, usually named using all capitals to be distinct from changing variables

In the above picture, you can see an example of camel casing and using underscores to increase readability. You can also see the error message IDLE gives you when you try to find a variable that doesn’t exist. Every variable is case sensitive, so the exact name with the exact capitalization needs to be defined before trying to refer to the variable. After initializing a variable, subsequent uses of the variable name in expressions are known as variable references. You can see the variable reference to camelCasing in the second line of code above.
Variables serve a couple very important purposes in programs. They help the programmer keep track of data that change over the course of time. They also allow the programmer to refer to a complex piece of information with a simple name. It is common sense to choose names that inform human readers about the purpose of the data. This in turn makes the code easier to maintain, troubleshoot, and collaborate on.