Boolean in Python


 Boolean

          Data type with one of the two built-in values, "True" or "False". Boolean objects that are equal to True are truthy and those equal to False are falsy. It is represented by the 'bool' class.

Note : True and False with capital 'T' and 'F' are valid booleans otherwise Python will throw an error.


Example

print(type(True))

print(type(False))

print(type(true))


Output

< class 'bool'>

< class 'bool'>

"error"



No comments:

Post a Comment