Data Types
Welcome back, young developer.
In Step 1, your game learned how to remember things.
Now itβs time to teach it what kind of things itβs remembering.
Because right now your game is basically asking:
βIs 42 a number? A name? A vibe? A cry for help?β
Letβs fix that.
THE BIG FOUR DATA TYPES
These are the four types you will use for most game logic.
- Integers
- Floats
- Strings
- Booleans
1. Integers β Whole Numbers (No Decimals Allowed)
What they are:
Numbers without decimals. Clean. Simple. Whole numbers.
The βno dramaβ numbers.
No decimals. No fractions. No chaos.
Used for:
- health
- coins
- ammo
- enemy count
health = 100
coins = 25
print(health, coins)
2. Floats β Numbers With Decimals
What they are:
Integersβ dramatic cousins. They show up with decimals like β3.14159 because Iβm special.β
Used for:
- speed
- accuracy
- damage multipliers
- jump height
- anything that needs precision
speed = 4.5
gravity = 9.8
print(speed, gravity)
3. Strings β Text
What they are:
Anything inside quotes.
Words, sentences, symbols, emojis β all strings.
If you can type it like a message to your friend, itβs a string.
Used for:
- player names
- item names
- dialogue
- dramatic boss warnings
player_name = "Nova"
weapon = "Bow"
print(player_name, weapon)
4. Booleans β True or False
A data type that can only be
True or False.
The βyes/no,β βon/off,β βis it happening or notβ data type. No maybes. No situationships.
Used for:
- is the player alive
- is the door locked
- is the boss angry
- is the game over
is_alive = True
boss_defeated = False
print(is_alive, boss_defeated)
Code Example: All Four Types in Action
player_name = "Nova" # string health = 100 # integer speed = 3.5 # float is_alive = True # boolean print(player_name, health, speed, is_alive)
Practice (Your Turn!)
Mini Challenge β Game Data
Create variables for:
- player name (string)
- health (integer)
- speed (float)
- is_alive (boolean)


