⚙️ Operators

Last Updated: 15th August 2025


Operators are special symbols that perform actions on values or variables.
Example: 5 + 3 — here + adds two numbers.

Hinglish Tip 🗣: Operators ko aise samjho — chhote tools jo numbers/values par kaam karte hain (add, compare, join, etc.).


🧭 Types of Operators

CategoryOperatorsPurpose
Arithmetic+, -, *, /, //, %, **Math calculations
Assignment=Assign/update variables
Compound+=, -=, *=, /=, %=, **=, //=Update variables
Comparison (Relational)==, !=, >, <, >=, <=Compare values → True/False
Logicaland, or, notCombine/negate conditions
Bitwise&, |, ^, ~, <<, >>Work at bit level
Identityis, is notCheck same object in memory
Membershipin, not inCheck presence in sequence

✏ Mini Example

a = 7
b = 3
print(a + b)                # 10 (Arithmetic)
print(a > b)                # True (Comparison)
print((a > 5) and (b < 5))  # True (Logical)

💡 Don’t worry! We’ll explore each of these in full detail in the next sections.