Python Programs | IT Developer
IT Developer

Python Programs



Share with a Friend

Print truth values of Boolean expressions - Python Program


In Python, the truth values of boolean expressions are represented by the built-in True and False keywords. These keywords are of the bool data type.

To print the truth value of a boolean expression, you can directly print() the expression itself, as the result of a boolean expression will always be either True or False.

# Evaluates and prints results of Boolean expressions print(5 > 3) print(10 == 10) print(7 < 4) print(True and False)

Output

 
OUTPUT 1:
True
True
False
False

Description:

Demonstrates logical comparisons and Boolean operations (and, ==, <, >).