Python bool() function
Published February 17, 2022The Python bool() function returns or converts a value to a Boolean value, i.e., True or False, following a standard truth test procedure.
The Syntax of bool()
The syntax of bool() function includes:
bool([argument to be tested]) |
The bool() function generally accepts just one argument, which may be used to do basic truth checking. If no argument is specified, False is returned by default.
Example
In this example, we are going to text whether the variables x and y are equal
x = 50 |
Output
True |
Article Contributed By :
|
|
|
|
238 Views |