Math Fundamentals18 sections · 814 units
Open in Course

The AND Operator

Both must be true

The AND operator returns true only when both inputs are true. Written as && in most languages, or and in Python. Mathematically:

ABA \land B is truetrue if and only if both AA and BB are truetrue.

If either input is false, the result is false. Think of AND as a gate: both conditions must pass for the gate to open. One failure blocks everything.

Example: if (age >= 18 && hasLicense) checks two things. If age is 20 but hasLicense is false, the whole expression is false.