
Operators are special symbols or keywords that perform operations on values (operands).
Example:
a = 10
b = 5
print(a + b) # Output: 15
Here, + is the operator, and a and b are operands.
Used for basic math operations.
| Operator | Meaning | Example | Result |
|---|---|---|---|
+ |
Addition | 5 + 3 |
8 |
- |
Subtraction | 5 - 3 |
2 |
* |
Multiplication | 5 * 3 |
15 |
/ |
Division | 5 / 2 |
2.5 |
// |
Floor Division | 5 // 2 |
2 |
% |
Modulus (remainder) | 5 % 2 |
1 |
** |
Exponentiation | 2 ** 3 |
8 |
Used to compare values.
| Operator | Meaning | Example | Result |
|---|---|---|---|
== |
Equal to | 5 == 5 |
True |
!= |
Not equal to | 5 != 3 |
True |
> |
Greater than | 5 > 3 |
True |
< |
Less than | 5 < 3 |
False |
>= |
Greater or equal | 5 >= 5 |
True |
<= |
Less or equal | 3 <= 5 |
True |
Used to combine conditions.
| Operator | Meaning | Example | Result |
|---|---|---|---|
and |
True if both are True | (5 > 3 and 2 < 4) |
True |
or |
True if at least one is True | (5 > 3 or 2 > 4) |
True |
not |
Negates the condition | not(5 > 3) |
False |
Used to assign values to variables.
| Operator | Meaning | Example | Equivalent |
|---|---|---|---|
= |
Assign | x = 5 |
x = 5 |
+= |
Add and assign | x += 3 |
x = x + 3 |
-= |
Subtract and assign | x -= 2 |
x = x – 2 |
*= |
Multiply and assign | x *= 4 |
x = x * 4 |
/= |
Divide and assign | x /= 2 |
x = x / 2 |
Operate on binary numbers.
| Operator | Meaning | Example | Result | ||
|---|---|---|---|---|---|
& |
AND | 5 & 3 |
1 | ||
| ` | ` | OR | `5 | 3` | 7 |
^ |
XOR | 5 ^ 3 |
6 | ||
<< |
Left shift | 5 << 1 |
10 | ||
>> |
Right shift | 5 >> 1 |
2 |
Fill out the Get Help form and our team will contact you.
We accept UPI, Debit/Credit Cards, and Net Banking.
Yes, installment options are available for selected courses.
Yes, we provide resume and interview support.