# Logical operators let you combine or modify conditions
# Three operators: and, or, not — all return a bool

# ─────────────────────────────────────────────
# and — both must be true
# ─────────────────────────────────────────────

age = 20
has_id = True

print(age > 18 and has_id)   # True — both conditions met

age = 16
print(age > 18 and has_id)   # False — age condition fails

# and truth table
print(True and True)    # True
print(True and False)   # False
print(False and True)   # False
print(False and False)  # False

# ─────────────────────────────────────────────
# or — at least one must be true
# ─────────────────────────────────────────────

is_student = False
is_senior = True

print(is_student or is_senior)   # True — at least one is true

is_student = False
is_senior = False

print(is_student or is_senior)   # False — neither is true

# or truth table
print(True or True)    # True
print(True or False)   # True
print(False or True)   # True
print(False or False)  # False

# ─────────────────────────────────────────────
# not — flips the value
# ─────────────────────────────────────────────

is_banned = False
print(not is_banned)   # True — flipped

is_banned = True
print(not is_banned)   # False — flipped

print(not True)   # False
print(not False)  # True

# ─────────────────────────────────────────────
# Combining operators
# ─────────────────────────────────────────────

age = 20
has_id = True
is_banned = False

print(age > 18 and has_id and not is_banned)   # True

# With comparison operators
price = 85
is_member = True

print(price < 100 or is_member)     # True
print(price < 50 and is_member)     # False
print(not is_member or price < 50)  # False
