Welcome back, Python Cub! 🐾
You already know how to use variables, which are like labeled boxes.
But now comes an important question:
👉 What kind of things can those boxes hold?
In Python, the type of thing stored inside a variable is called a data type.
Let’s understand data types using toys, school bags, and everyday life, so it feels easy and fun.
Think of Variables Like Toy Boxes
Imagine you have different toy boxes at home:
- One box only holds toy cars
- One box holds stuffed animals
- One box holds number blocks
You wouldn’t put a teddy bear in a tiny matchbox, right?
Python thinks the same way.
It likes to know what kind of data you are storing.
That “kind” is called a data type.
What Are Data Types?
A data type tells Python:
- What kind of value a variable is holding
- What you can do with that value
Python has many data types, but beginners only need to know four main ones.
Let’s meet them one by one.
1. Integer (int) – Whole Numbers
An integer is a whole number.
No dots. No decimals.
Real-Life Example
Think of:
- Number of toys you have
- Your age
- Number of students in a class
Python Example
age = 10
toys = 15
score = 100
All of these are integers.
📌 Python name: int
2. Float (float) – Numbers With Dots
A float is a number that has a decimal point.
Real-Life Example
Think of:
- Your height
- Weight
- Price of candy
Python Example
height = 4.5
weight = 32.7
price = 10.99
These numbers are floats.
📌 Python name: float
3. String (str) – Words, Names & Sentences
A string is anything inside quotes ” “.
Real-Life Example
Think of:
- Your name
- Your favorite toy
- A sentence in a book
Python Example
name = "Alex"
favorite_toy = "Lego"
message = "I love Python"
Even numbers inside quotes are strings:
number = "10"
📌 Python name: str
4. Boolean (bool) – True or False
A boolean can only be True or False.
Real-Life Example
Think of questions like:
- Is the light on?
- Is it raining?
- Did you finish your homework?
Python Example
is_raining = True
homework_done = False
Booleans help Python make decisions later.
📌 Python name: bool

Why Data Types Matter ?
Let’s look at this example:
print(5 + 5)
Output:
10
But this:
print("5" + "5")
Output:
55
Why?
Because Python treats numbers and strings differently.
Data types tell Python how to behave.
🪄 Checking a Data Type
Python has a magic tool called type().
age = 10
print(type(age))
Output:
<class ‘int’>
Try it with other values!
Common Beginner Mistakes
❌ Forgetting Quotes
name = Alex
✅ Correct:
name = "Alex"
❌ Mixing Wrong Types
print("Age:" + 10)
This causes an error.
For now, use commas:
print("Age:", 10)
Mini Practice (Try This!)
1️⃣ Store your age as an integer
2️⃣ Store your height as a float
3️⃣ Store your name as a string
4️⃣ Store if you like Python as True or False
Example:
likes_python = True
Summary: Data Types Made Simple
| Data Type | What It Stores | Example |
| int | Whole numbers | 10 |
| float | Decimal numbers | 3.5 |
| str | Text | “Python” |
| bool | True / False | True |
What’s Next on Python Cubs?
Next, you’ll learn:
👉 Taking input from users
👉 Using data types together
👉 Making decisions with if–else
You’re building real Python skills step by step 🐍
Keep going, Python Cub! 🐾
