TrueEasy Examples

Boolean literal representing true/1

Boolean True value

A basic demonstration of the True literal.

python
result = True
print(result)
print(type(result))

if result:
    print("True is truthy")
Expected Output
True
<class 'bool'>
True is truthy

True is one of Python's two boolean literals. It evaluates as truthy in conditions and equals the integer 1.

True in comparisons

Comparing True with other values.

python
print(True == 1)
print(True == 1.0)
print(True is 1)
print(bool(1))
print(bool("non-empty"))
Expected Output
True
True
False
True
True

True equals 1 in value comparison. Non-empty strings and non-zero numbers are truthy.

Want to try these examples interactively?

Open Easy Playground