Python Notes – Boolean
These notes explain Boolean values in Python, comparison operators, and how Python returns True or
False based on conditions.
Real World Question Boolean Result
Age valid? True / False
Password correct? True / False
Game over? True / False
1. Boolean Variable
isGameOver = False
print(isGameOver)
# False
2. Equal To (==)
print(10 == 10)
# True
print(10 == 5)
# False
3. Not Equal To (!=)
print(10 != 5)
# True
print(10 != 10)
# False
4. Greater Than (>)
print(10 > 5)
# True
5. Less Than (<)
print(2 < 1)
# False
6. Greater Than or Equal To (>=)
print(10 >= 10)
# True
7. Less Than or Equal To (<=)
print(5 <= 2)
# False
8. Boolean from String Comparisons
print("apple" == "apple")
# True
print("apple" == "banana")
# False
9. Case Sensitivity
print("Python" == "python")
# False
# Python is case-sensitive
Important Boolean Concepts
Concept Why Important?
True & False Base of decision making
Comparison Operators Used in conditions
String Comparison Frequently used in apps
Case Sensitivity Important for passwords/login
Boolean Logic Used in loops and if conditions
Practice Tip: Boolean concepts are heavily used in real applications like login systems, game
development, validations, and decision making.