Primitive Data Types
Primitive data types refer to a single piece of data (such as an integer or a character). Primitive data types are sometimes called atomic because they can’t be broken down any further.
Boolean
Perhaps the most important data type is the Boolean. The Boolean (named after George Boole, an English mathematician) is the simplest type of data: 1 or 0, on or off, yes or no, true or false. All the logic that happens within a computer program depends on the Boolean data type. In Chapter 7, “If, For, While, and When,” you learn all about if statements and while statements and how to use Booleans to control how your program works. Try out the code in Listing 5.2 to see Booleans in action. For more on how to try out code, take a look ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access