And operator: Difference between revisions
From Coderwiki
More actions
new: info, syntax, examples where true, examples where false |
(No difference)
|
Latest revision as of 10:34, 15 August 2025
The and operator is a boolean operator which will return true if the two boolean values either side of it are both true.
Syntax
edit edit sourceIn many languages, the and operator uses the && symbols.
In some other languages, a keyword is used instead: in Python, for example, this keyword is and.
Examples where and returns true
edit edit sourcetrue && true
4 < 7 && 9 > 2
(!false) && true
Examples where and returns false
edit edit sourcefalse && false
false && true
6 < 10 && 5 == 8