Knowledge Base‎ > ‎Programming‎ > ‎Python‎ > ‎Python Reference‎ > ‎

boolean


Related:

 Examples

 
 
test = True

 Description        

 
Booleans are a type in Python. They can have the value True or False.

 Syntax

 
 

 Parameters

 

 Interpreter

 Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) 

[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> test = True

>>> type(test)

<type 'bool'>

>>> if test:

...   print "this must be true!"

... 

this must be true!





Comments