Boolean

From Computer Science Wiki
Revision as of 05:57, 5 August 2017 by Mr. MacKenty (talk | contribs) (Created page with "right|frame|Programming basics<ref>http://www.flaticon.com/</ref> In most computer programming languages, a Boolean data type is a data type with only two...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Programming basics[1]

In most computer programming languages, a Boolean data type is a data type with only two possible values: true or false.[2]

By convention we can express true as the integer 1 and false as the integer 0 (zero). Please be careful as some programming languages treat an empty or unset value as FALSE.

Example[edit]

In PHP:

<?php
$myFirstVar = True; // assign the value TRUE to $myFirstVar
$myOtherVar = False; // assign the value FALSE to $myOtherVar
?>


In Python:

myFirstVar = True
myOtherVar = False



Do you understand this?[edit]

Standards[edit]

  • Define the terms: variable, constant, operator, object.

References[edit]