🏷️ Data Types for Kids

Different kinds of stuff need different kinds of boxes.

Why Types?

You wouldn't store ice cream in a cardboard box. Different things need different containers. Code is similar β€” numbers, words, and yes/no answers all behave differently, so we use different "types" of boxes.

The Main Types

  • Numbers β€” like 7 or 3.14.
  • Strings β€” words and letters in quotes, like "Hello".
  • Booleans β€” only two values: true or false.
  • Lists β€” many things in order, like ["apple","banana","cherry"].

Why Does This Matter?

You can add two numbers (7 + 3 = 10), but you can't really "add" the booleans true + false. The type tells the computer what makes sense.

🎯
Try this!

Now you try! What type would you use for: your age? your name? whether you like pizza?

πŸ‘¨β€πŸ‘©β€πŸ‘§
For grown-ups

Parent/teacher tip: Concrete examples help β€” money is a number, addresses are strings, "is it raining?" is a boolean.