BOOLEAN

A boolean is a built-in data type that can have one of two values: True or False. Booleans are often used in conditional statements, loops, and other control flow structures to make decisions based on whether a certain condition is true or false.

Assigning boolean values to variables

is_true = True

is_false = False

Using booleans in conditional statements

if is_true:

    print("This statement is true.")

else:

    print("This statement is false.")

Using booleans in expressions

result = 10 > 5  # This will be True

print(result)

Combining boolean values with logical operators

and_result = is_true and is_false  # This will be False

or_result = is_true or is_false    # This will be True

not_result = not is_true           # This will be False