Practice with Relational and Logical Operators

1. Understanding Boolean Logic

The Boolean data type can be one of two values, either True  or False . We use Booleans in programming to make comparisons and to control the flow of the program.

Booleans represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science. Named for the mathematician George Boole, the word Boolean always begins with a capitalized B. The values  True and  False  will also always be with a capital T and F respectively, as they are special values in Python.

In this tutorial, we’ll go over the basics you’ll need to understand how Booleans work, including Boolean comparison and logical operators, and truth tables.




Source: Lisa Tagliaferri, https://cuny.manifoldapp.org/read/how-to-code-in-python-3/section/01a1ddd6-7664-418a-adf5-1c3c369ad6c5#understanding-boolean-logic
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License.