Skip to main content

Lesson 1.1: Numbers, Text, and True or False

A value is one piece of information used by a program. Its data type tells the program what kind of information it is and which operations make sense for it.

  • A number can be used in math. Examples are 7, -2, and 3.5.
  • Text is a group of characters. Text may contain letters, spaces, or digits, such as team 7.
  • A Boolean has exactly two possible values: true or false. Comparisons and conditions use Boolean results.

The number 12 and the text "12" look related, but they have different types. Adding numbers can produce 24. Joining two text values can produce 1212. A program needs the correct type to perform the intended operation.

Guided practice

Print a number, a text value, and a Boolean value on separate lines. Predict how each will appear in the output. Then build a comparison such as 5 > 3 and print its result.

Change only one input at a time. Find a comparison that produces true, then one that produces false. State the data type of each result.

Loading the block workspace...

Ready to move on?

Only mark complete if you genuinely understand the material. Your progress will be saved in this browser.

Stuck on this lesson?

Ask about anything on this page. It can see which lesson you have open and which part you are reading.