Starter Town Ep. 3: Bento Bytes
You’re packing your lunchbox for another adventure. But this time, a vendor nearby catches your ear. “Careful” they say, “You gotta sort by type!”
You look down at your bento tray. Each section neatly labeled.
A balanced bento. Let’s learn why that matters.
What kind of snacks do we have?
You already know variables are like labeled snack boxes.
But here’s the twist: each snack also has a flavor (type) — a category that tells the computer how it should be used.
We’re not just storing snacks anymore…
We’re sorting them.
Let’s look at the most common data types and how they fit into your bento.
Type : What it is - Example
-----------------------------------------------
String : Words & text - “Juice”
Char : A single character - ‘A’
Integer: Whole numbers - 5
Float : Decimals & Precision - 3.14
Boolean: True/False - False
These are all primitive types and the ingredients that build your program.
Empty snack boxes…
Sometimes, you create a variable but don’t put anything in it yet.
That’s okay — as long as you’re clear about it.
We use special keywords to say, “This box is intentionally empty for now.”
snack = none
Think of it as a snack tray with a label, but nothing inside yet. It’s not broken — just waiting to be filled.
**Some beginners use None
(or null
, or undefined
in other languages) as a “just put anything here” button. Don’t fall into that trap!**
Use it only when you truly mean, “This has no value yet — but it will.”
Like a player’s name at the start of a new game before it’s been entered.
A balanced bento
Here’s what a healthy set of variables could look like
snack = "onigiri" # string
snack_count = 2 # integer
snack_price = 4.50 # float
is_delicious = True # boolean
first_letter = 'O' # char
snack_note = None # empty for now
Each one is clearly labeled and stored in the right compartment. Now the computer knows how to treat each value too.
Food for thought
Pop quiz! Try to identify each type.
Some languages are dynamically typed — which means you don’t clearly write what it is but the computer can guess by context — like is there a decimal? Quotation marks? We can use clues.
name = "Blackcat"
lives = 9
monies = 2.50
awake = False
Quest Log Updated.
• Data comes in different types
• Each type helps the computer understand what the value is
• Mixing types can cause errors (and messy lunches!)
• You can useNone
for empty-but-labeled variables — just don’t overdo it
Episodes
Previous: Snack Boxes and Memory | Next: Shopping without a list