Boolean values: Difference between revisions

added python
m (Should have previewed)
(added python)
Line 7:
=={{header|Java}}==
Java has <tt>true</tt> and <tt>false</tt> keywords. There are also object wrappers <tt>Boolean.TRUE</tt> and <tt>Boolean.FALSE</tt> which act in the same places, but have methods defined for them.
 
=={{header|Python}}==
The values in Python that are false are: <code>False</code>, <code>None</code>, 0 (including 0 of all numeric types, and any object whose <tt>.__nonzero__()</tt> method returns false), and empty containers (including empty strings, lists, tuples, dictionaries, sets, etc., and any object whose <tt>.__len__()</tt> method returns 0).
 
Everything else is true. Constant <code>True</code> exists.
 
=={{header|Ruby}}==
Anonymous user