- Learn Python in 7 Days
- Mohit Bhaskar N. Das
- 81字
- 2025-04-04 19:20:06
Boolean data type
A Boolean data type generally has only two values 'True' or 'False'. Boolean data type is a sub type of integers.
Syntax:
<variable name>=<'True' or 'False'>
Boolean data types can be referred to as an on and off switch, which has only two values to chose from:

In the preceding example, we try to compare the value of x with the value of y, and when we use the == operator, the value of the Boolean is returned as True.