Use the Touch Develop *var* statement to create a local variable and the [assignment operator](/reference/variables/assign) `=` to store something in the variable.
Once you've defined a variable, just use the variable's name whenever you need what's stored in the variable. For example, the following code shows the value stored in `counter` on the LED screen:
```
basic.showNumber(counter, 100)
```
To change the contents of a variable use the assignment operator `:=`. The following code sets `counter` to 1 and then increments `counter` by 10:
```
counter = 1
counter = counter + 10
```
### Why use variables?
Variables help simplify your code. For example, instead of turning on LEDs one by one like this:
You can use a variable (`i`) and a [for loop](/reference/loops/for) to plot the same series of points (`i` is incremented by 1, each time the loop repeats):
Local variables exist only within the function or block of code where they're defined. Local variables don't exist outside of where they're defined. For example:
* You can use the default variable names if you'd like, however, it's best to use descriptive variable names. To change a variable name in the editor, select the variable and then click `rename`.
* Be careful not to confuse the assignment `:=` operator with the equals `=` operator.
[guess the number](/lessons/guess-the-number), [digi yoyo](/lessons/digi-yoyo), [rock paper scissors](/lessons/rock-paper-scissors), [love meter](/lessons/love-meter)