Arithmetic operators +, -, *, /, %
Arithmetic operators perform common mathematical operations on values.
‘%’ is for modulo (remainder after division).
Relational operators
Relational operators are used to compare values, where
‘==’ checks equality
‘!=’ checks inequality
‘>’ checks if the left value is greater than the right
‘<‘ checks if the left value is less than the right
‘>=’ checks if the left value is greater than or equal to the right
‘<=’ checks if the left value is less than or equal to the right.
Logical operators
Logical operators are used to combine or modify Boolean logic values:
AND – Returns True if both the operands are true.
OR – Returns True if at least one of the operands is true.
NOT – Returns True if the operand is false, and False if the operand is true, effectively inverting the operand’s Boolean value.
These operators are fundamental in controlling the flow of a program by allowing the execution of code to depend on various conditions.
Note: An operand is a value that is operated on by an operator within an expression. In other words, operands are the data that operators use to perform operations. For example, in the arithmetic operation `5 + 3`, the numbers `5` and `3` are the operands, and the `+` is the operator.