Javatpoint Logo
Javatpoint Logo

Python bool() Function

The python bool() method converts value to boolean (True or False) using the standard truth testing procedure.

Signature

Parameters

It is not mandatory to pass value to bool(). If you do not pass the value, bool() returns False.

In general , bool() takes a single parameter value.

Return

The bool() returns:

  • False if the value is omitted or false
  • True if the value is true

Python bool() Function Example

Output:

[] is False
[0] is True
0.0 is False
None is False
True is True
Easy string is True





Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA