Lesson 4 of 13

Data Types: What Kind of Stuff? 🗂️

Numbers, words, true/false — every piece of data has a TYPE. Think of it like different shaped containers that only hold certain things!

🔢 Integer
📝 String
💧 Float
✅ Boolean
📋 List
🤔 What Are Data Types?

Every Value Has a Type!

Just like different containers hold different things — code does too!

When I first started coding, I didn’t understand why 5 and "5" were different things. My teacher said — “Think about your kitchen.” You keep juice in a glass, soup in a bowl, and pencils in a box. You wouldn’t put soup in a pencil box! Code is the same — every type of data has its own container! 🧪

🔢
int
42
📝
str
“hello”
💧
float
3.14
bool
True
📋
list
[1,2,3]

📚 The 5 Main Data Types

Every Beginner Must Know These!

Learn each one — with real examples and code!

🔢 int

Integer — Whole Numbers Only!

Integers are whole numbers — no dots, no decimals. Positive, negative, or zero. Perfect for counting things like scores, ages, or steps!

42 -7 0 100 2026
# Integers in action
age = 10
score = 500
# type(age) → int
📝 str

String — Any Text in Quotes!

A string is any text wrapped in quote marks. Your name, a message, a sentence — all strings! The quotes tell the computer “this is text, not a command!”

“Sara” “Hello!” “coding” “123”
# Strings in action
name = “Sara”
msg = “I love coding!”
# type(name) → str
💧 float

Float — Numbers with Decimals!

Floats are numbers with a dot and decimal point. Think prices, temperatures, measurements — anything that isn’t perfectly whole!

3.14 9.99 37.5 -0.5
# Floats in action
price = 4.99
temp = 37.5
# type(price) → float
bool

Boolean — Just True or False!

Booleans only have two possible values — True or False. That’s it! They’re used for yes/no questions in your code — like a light switch. On or off!

True False

I use these with if/else all the time — “is the game over? True or False?” 🎮

# Booleans in action
is_raining = True
game_over = False
# type(is_raining) → bool
📋 list

List — Many Items Together!

A list holds multiple values in one place. Mix different types, or keep them the same. Use square brackets [ ] to make one!

[“Ali”,”Sara”] [1,2,3] [True,False]
# Lists in action
friends = [“Ali”, “Sara”]
scores = [90, 85, 78]
# type(friends) → list

🎮 Type Sorter Game!

Can You Guess the Right Type?

Look at the value — pick its data type! See how many you get right!

🧪 Data Type Sorter

8 values to sort · tap the correct type!

🎯 Loading… What type is this?
Score: 0 / 0

🌍 Data Types in Real Life

You Use These Every Day!

Data types aren’t just coding — they’re everywhere!

🎮

Video Game

Player name is a String. Score is an Integer. Is game over is a Boolean!

str + int + bool
🛒

Online Shop

Product name is a String. Price is a Float. Items in cart is a List!

str + float + list
🌤️

Weather App

City name is a String. Temperature is a Float. Is raining is a Boolean!

str + float + bool
🏫

School System

Student name is a String. Age is an Integer. Subjects is a List!

str + int + list

📋 Quick Cheatsheet

All 5 Types at a Glance!

Save this — you’ll need it every time you code!

TypeWhat it holdsExampleReal life
intWhole numbersage = 10Score, age, count
strText in quotesname = “Ali”Names, messages
floatDecimal numbersprice = 9.99Money, temperature
boolTrue or False onlyon = TrueOn/off, yes/no
listMany itemsitems = [1,2,3]Playlists, scores

🧠 Quick Quiz!
🎯 Data Types Quiz

4 questions · pick an answer to check!

⭐ Remember This!

🗂️

Data types tell the computer what kind of data it’s working with

🔢

int = whole numbers, float = decimals

📝

str = text in quotes, bool = True or False

📋

list holds many values together in one place