🔀 Comparison Operators.
Last Updated: 15th August 2025
Comparison operators are used to compare two values and they always return a Boolean (True or False).
Hinglish Tip 🗣: Comparison operators se aap check karte ho — kya do values same hain, badi hain, chhoti hain, etc. Result hamesha True ya False hota hai.
✏ Syntax & Examples
a = 10
b = 20
print(a == b) # False
print(a != b) # True
print(a > b) # False
print(a < b) # True
print(a >= 10) # True
print(b <= 20) # True
💡 Quick Practice
- Check if 15 is greater than 10.
- Test if 7 == 7.
- Compare if 100 <= 100.
- Print the result of "cat" < "dog".
- Try 2+3j == 2+3j and see the result.
- Exercises
