Text & Characters
Anything wrapped in quotes. Even "25" in quotes is treated as text, not a quantity!
Whole Numbers
Whole numbers without quotes or decimals. Ready for arithmetic: +, -, *, /.
Truth Switch
Only two possible values: True or False. Powers every decision in code.
Notice how the + symbol changes meaning—or raises an error—depending on the data types involved:
5 + 3 → 8), while adding two strings glues them together end-to-end ("5" + "3" → "53").
When you have text like "25" and need to do math—or have a number like 25 and want to glue it into a sentence—you use casting functions (int(), str(), bool()) to transform its type:
int() and str() transform data!
type(), int(), str())
+ Explore
# Inspect any value's type using type()
type("hello") # <class 'str'>
type(42) # <class 'int'>
type(True) # <class 'bool'>
# Convert between types explicitly
age_num = int("25") # "25" (str) -> 25 (int)
msg = "Score: " + str(100) # 100 (int) -> "100" (str)
TypeError, ask yourself: "What type is inside each box right now, and do I need int() or str() to bridge them?"