bool function

bool bool(value)

value floatboolstring Value to convert.

Returns the value converted to boolean.

This function converts value to the corresponding boolean value. Float values are false if they are equal to 0, true otherwise. Strings are false if equal to "f", "false", "0", "0.0" etc., true otherwise.

Related

Examples

bool(1)
# result = true

bool(0)
# result = false

bool("1")
# result = true

bool(6.66)
# result = true

bool("false")
# result = false

bool("f")
# result = false

bool("true")
# result = true

bool("beneath the remains")
# result = true

bool(11.5 == 0)
# result = false