Skip to content

Beginning of the lesson

Data Types and Values

Every piece of information has a kind — let's meet them

Big Idea: A computer stores lots of values — a score, a name, a yes-or-no answer. Every value has a type. The type tells the computer what kind of thing it is and what it can do with it.
By the end you will be able to:
  • say what a value and a type are,
  • name the three main types: number, text, and true/false,
  • explain why "5" (text) is not the same as 5 (a number).

1. What is a value?

A value is a single piece of information the computer is holding right now. Your game score is a value. Your name is a value. Whether the light is on or off is a value.

Think of a computer's memory as a wall of tiny boxes. Each box can hold one value. When the game says your score is 7, one little box is holding the value 7.

A value is the thing itself — the number 7, the word "cat", the answer "yes". A type is what kind of thing it is.

2. The three main types

Values come in different types. When you are starting out, three types matter most:

TypeWhat it holdsExamples
Numberamounts you can count or measure, and do math with5, 42, 3.14
Text (also called a string)letters, words, and symbols written down"cat", "Hello!", "5"
True/False (also called a boolean)a yes-or-no answer — only two choicestrue, false

Text is often written inside quotation marks like "cat", so the computer knows where the words begin and end.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers