Next →

What is a Boolean?

A Boolean is a data type that represents either True or False.

Example:

is_raining = True
is_sunny = False

Booleans are useful for making decisions in your code — especially when working with conditions and filters.

Comparison Operators

Comparison operators compare two values and return a Boolean result (True or False). Here are the most common:

You can also store comparisons in variables:

is_older = age > 18