Video 4: Operators
In this lesson, we’ll discuss operators. Operators allow us to use comparisons (i.e. equal to, not equal to, etc.), allow us to complete arithmetic (i.e. addition, subtraction, etc.), logical operations (i.e. AND, OR, NOT, etc.) and even concatenation (i.e. combine two or more strings).
- Arithmetic Operators
- + – Adds
- – – Subtracts
- * – Multiplies
- % – Returns the remainder (i.e. if B is 11 and A is 5, then B % A will give 1)
- ^ – Exponentiation
- Comparison Operators
- = – Check if a value equals another value
- <> – Check if a value is not equal to another value
- > – Greater than
- < – Less than
- >= – Greater than or equal to
- <= – Less than or equal to
- Logical Operators
- AND – If both the conditions are True, then the Expression is true
- OR – If any of the two conditions are True, then the condition is true
- NOT – Used to reverse the logical state of its operand. If a condition is true, then Logical NOT operator will make false
- Concatenation Operators
- & – Concatenates two strings together