Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NormandoRamirezDelgado/6C-Febrero-2026/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Logical operators are used to combine or invert boolean values. They are essential for creating complex conditions in your programs.Logical Operators Table
| Operator | Name | Description | Example | ||||
|---|---|---|---|---|---|---|---|
&& | AND | Returns true if both operands are true | true && false → false | ||||
| ` | ` | OR | Returns true if at least one operand is true | `true | false→true` | ||
! | NOT | Inverts the boolean value | !true → false |
Basic Example
Here’s a complete example demonstrating logical operators:AND Operator (&&)
The AND operator returns true only when both conditions are true.
Truth Table for AND
| Left | Right | Result |
|---|---|---|
true | true | true |
true | false | false |
false | true | false |
false | false | false |
Example
The AND operator uses “short-circuit” evaluation: if the left operand is
false, the right operand is not evaluated because the result will always be false.OR Operator (||)
The OR operator returns true when at least one condition is true.
Truth Table for OR
| Left | Right | Result |
|---|---|---|
true | true | true |
true | false | true |
false | true | true |
false | false | false |
Example
The OR operator also uses “short-circuit” evaluation: if the left operand is
true, the right operand is not evaluated because the result will always be true.NOT Operator (!)
The NOT operator inverts a boolean value.
Truth Table for NOT
| Value | Result |
|---|---|
true | false |
false | true |