Member-only story
Learning Programming Fundamentals using Python — Variables and Data types.
Exploring variables using Python
Recap
Welcome! This is a series where I introduce programming fundamentals in the programming language Python. In the last article I talked about data types.
All programs basically do one thing, they take in some data, and output some data. What a program does with that data depends heavily on the type of data it’s receiving, and I covered those basics here. The problem is, when the program takes in some data it usually needs a place to put it, we have to store it somewhere and that’s where variables come in.
Variables are one of the ways we can store these different data types.
What are Variables?
Variables are essentially places to store data. In Python we can declare variables using an assignment statement shown below:
some_variable_name = some_data
Assignment statements are pretty simple, we declare our variable on the left, and set it equal to some expression on the right. Variables in Python hold references to their values.
some_variable_name = 1
In the example above, we create a variable called some_variable_name
and set it equal to 1…