Search⌘ K
AI Features

Booleans

Explore how Booleans represent truth values in Python 3, including the constants True and False. Understand how expressions evaluate to Booleans in different contexts and discover how Python interprets truthiness in various data types.

We'll cover the following...

Booleans are either true or false. Python has two constants, cleverly named True and False, which can be used to assign boolean values directly. Expressions can also evaluate to a boolean value. In certain places (like if ...