How variable are used in programming

Variables are used in programming to store and manipulate data. They can hold different types of values such as numbers, strings, or boolean values.

Variables are declared with a specific data type and a name, which is used to refer to the stored value. The value of a variable can be changed or updated during the execution of the program.

Here is an example of variable usage in programming:

```python
# declaring a variable and assigning a value
name = "John"

# using a variable in a calculation
age = 25
birth_year = 2021 - age

# updating the value of a variable
age = 26

# printing the value of a variable
print("My name is", name, "and I am", age, "years old.")
```

In this example, the variable `name` stores the string value "John". The variable `age` initially stores the number 25 but is later updated to 26. The variable `birth_year` stores the calculated value of the current year minus the value of `age`. Finally, the `print` statement uses these variables to display a formatted message.