liveBook · Manning

Boolean

As explained in Tiny Python Projects: Learn coding and testing with puzzles and games

A Boolean value is one of the two truth values, True or False, used to represent logical conditions.

A Boolean value represents one of two truth values: True or False. Comparisons such as char == 'o' return a Boolean value, while assignment with = changes a variable. section 2.1.10

Use Boolean values to test conditions and combine results:

Testing a vowel

>>> word = 'OCTOPUS' >>> word[0].lower() in 'aeiou' True The expression returns True because the lowercased first character, 'o', occurs in 'aeiou'. section 2.1.10

>>> char == 'a' or char == 'e' or char == 'i' or char == 'o' or char == 'u'
True

Inspect how several equality comparisons combine with or to return one Boolean result. section 2.1.10

How Tiny Python Projects: Learn coding and testing with puzzles and games covers it

How deep it goes
Explains comparisons, membership, case normalization, and combining conditions, but does not descend into Boolean implementation internals.
Examples
Demonstrates vowel detection, uppercase normalization, comparison output, and Tic-Tac-Toe winner checks.
What it assumes
Assumes basic Python variables, strings, indexing, and methods while reinforcing comparisons and logical operators.
What you can do after
Apply it via Python comparisons, membership tests, and logical operators to evaluate conditions in small programs.
How it connects
Connects Boolean values with string comparison, membership testing, logical operators, program state, and regular expressions.

Also explained in

Compare how 11 books explain boolean →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Tiny Python Projects: Learn coding and testing with puzzles and games. The section links point to the parts of the book it draws on.