The False keyword in python

The False keyword in Python represents the negative truth value of Boolean logic and it belongs to the type bool.

Keywords Updated 19 Jan 2017 1 min read

Overview

In Boolean logic "False" is a negative truth-value representing nothing.

Often represented as zero, several programming languages have a separate keyword and separate type to represent "False".

In Python, the type “bool” represents the Boolean values: "True" and "False".

A Boolean type does not hold any other value other than "True" and "False".

Example

python
switchOn = False

if(switchOn):

    print("The state of the switch is On")

else:

    print("The state of the switch is Off")

visibility = 0

#Convert zero to bool value using bool() function

print("Visibility is {}".format(bool(visibility)))

Output

Output
The state of the switch is Off

Visibility is False