Welcome back! Ready for more?
I'm back too, and it's time to continue our Python journey.
Today, we'll explore variable types, the fundamental building blocks of Python.
Before we begin, do you know where to practice what I'm about to explain? If not, check out my previous post on this topic and then return here → https://davideavino.substack.com/p/python-for-non-programmers-ep1
Now, let's talk about Variables.
A variable is the simplest unit in a programming language. In many ways, programming can be thought of as combining different variables to create complex results.
But first, I need to introduce you to Python's most essential command—the one everyone uses for their very first line of code: the PRINT command.
This command makes visible whatever you ask Python to produce. Without it, your program will run but you won't see any results.
Let's try a simple example. Type this in your Shell:
print("World Hello")With this command, you’re asking Python to display whatever is written inside the brackets.
This example introduces some basic concepts about Python’s structure.
Here, print is a function that (similar to Excel) begins with a name followed by round brackets. Inside these brackets, you place the elements you want the function to work with.
In plain language: we’re telling Python to perform the action of “printing” (making visible) the words "World Hello".
Notice the quotation marks — they indicate that "World Hello" is a string, one of the variable types we’ll cover today.
Types of variables
In Python, there are many types of variables, but today we’ll focus on three: Strings, Integers, and Floats.
To check what type a value belongs to, you can use the type function.
(Pro tip: always wrap it inside print, so the result appears in the console.)
🔹 Strings
Let’s start with an example. In Python, you assign a value to a variable with the equal sign:
a = "My Beautiful name"This creates a variable called a with the value "My Beautiful name".
As mentioned earlier, when something is written between quotation marks, Python recognizes it as a string.
A string is usually a sequence of letters. I say “usually” because, with quotation marks, almost anything can be turned into a string — but that’s a topic for another day.
To check this in practice, try:
b = "My incredible name"
print(b)
print(type(b)Here’s what happens:
Python creates a variable
bwith the string"My incredible name"Then, we ask Python to print its value
Finally, we ask Python to print its type — which should return
str(short for string)
🔹 Integers
Integers are simply whole numbers — positive, negative, or zero.
Unlike strings, you don’t need quotation marks here.
x = 10
y = -5
print(x)
print(type(x))
print(y)
print(type(y))
This will print:
The number
10and its type →intThe number
5and its type →int
With integers, you can perform classic math operations like addition, subtraction, multiplication, and division:
a = 7
b = 3
print(a + b) # 10
print(a - b) # 4
print(a * b) # 21
print(a / b) # 2.333...
Notice that division gives you a decimal result — which brings us to the next type.
🔹 Floats
A float is a number with a decimal point.
pi = 3.14
temperature = -2.5
print(pi)
print(type(pi))
print(temperature)
print(type(temperature))
Both variables will return float as their type.
Floats are extremely common when you’re dealing with measurements, percentages, or calculations that aren’t exact integers.
For example:
x = 7
y = 3
print(x / y) # 2.333333333...
Here, dividing two integers produces a float, because the result isn’t a whole number.
Wrap-up
So far, you’ve seen three essential types of variables:
Strings → text values wrapped in quotes
Integers → whole numbers (positive or negative)
Floats → numbers with decimals
These are the building blocks you’ll use constantly in Python.
In the next post, we’ll explore how these different variable types can interact with each other — and what happens when you mix them together. 🧪
Final tip
If you've noticed, in my examples sometimes I put the # sign. That's used in Python to add comments within your code. This simply tells the program to ignore everything after the # symbol on that line while executing your instructions.
You can use comments to explain what your code is doing as you test it—this is extremely helpful during the learning process.



It's always useful to review some Python basics when you haven't used it in a while!