Python Boolean Type

The boolean value can be of two types only i.e. either True or False. The output <class ‘bool’> indicates the variable is a boolean data type.

Python3




a = True
type(a)
  
b = False
type(b)


Output:

<class 'bool'>
<class 'bool'>

Python Boolean

Python boolean type is one of the built-in data types provided by Python, which represents one of the two values i.e. True or False. Generally, it is used to represent the truth values of the expressions.

Example

Input: 1==1
Output: True

Input: 2<1
Output: False

Similar Reads

Python Boolean Type

The boolean value can be of two types only i.e. either True or False. The output indicates the variable is a boolean data type....

Evaluate Variables and Expressions

...

Boolean Operators

We can evaluate values and variables using the Python bool() function. This method is used to return or convert a value to a Boolean value i.e., True or False, using the standard truth testing procedure....