Introducing the Variable

First off, let’s answer the question: What is a variable in Python?

Without getting too complicated, a variable is simply a piece of memory, that the program can use to store something, whether it’s a number, word, decimal etc. In order to make a variable in Python, we first need to assign it to a value with the “=” sign, like follows

var = 1000

With this statement, we are making a variable, named “var”, and setting it equal to 1000. After a variable is assigned, it can be used elsewhere in the program. So if we add the following:

print(var)

We will see the number 1000 print out after we have assigned it.

Lesson Content