Variables

We can name anything we want, not only numbers. We can create a name containing the car make and another containing the car model:

>>> make = "Honda"
>>> model = "Civic"
>>> make
'Honda'
>>> model
'Civic'
>>>

As we already did with the gallon_price name, we can also change the content of these names:

>>> model = "Accord"
>>> model
'Accord'
>>> mpg = 30
>>> mpg
30
>>> mpg = 32
>>> mpg
32

When we can change the content of a name we call it a variable. Variables are a simple concept and a fundamental part of programming.

computer programming degree learning course tutorial