Lesson 2of 2
Truthy and Falsy Values in Python – Conditional Logic Simplified
Understand how truthy and falsy values work in Python. Learn which values evaluate to True or False in conditional statements, with examples and practical tips for beginners.
In Python, some values are treated as True or False automatically when used in conditions.
Falsy values (evaluated as False):
NoneFalse0(any numeric zero)""(empty string)[](empty list){}(empty dict)set()(empty set)
Everything else is truthy.
username = ""
if username:
print("Welcome,", username)
else:
print("Please enter a valid username")Since username is an empty string (""), it's falsy — the else block runs.
✅ Quick Practice Example
score = 75
if score:
if score >= 90:
print("Grade A")
elif score >= 75:
print("Grade B")
else:
print("Grade C")
else:
print("No score provided")