Skip to main content

Python: Boolean Type

Python Boolean is in-built data type which is defined by the True or False keywords. Boolean objects that are equal to True are truthy (true), and those equal to False are falsy (false). 

Example:

print(type(True))
print(type(False))

Output:

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

Example:

a = 3
b = 4
print(a == b)
print(bool(a))

Output:

False
True
Tags
Submitted by devanshi.srivastava on June 26, 2021

Devanshi, is working as a Data Scientist with iVagus. She has expertise in Python, NumPy, Pandas and other data science technologies.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.