← Back to Blog

Common Bool Mistakes

The problem...

Bool is the simplest type in Python. Two values. That's it.

And yet, it's one of the most misused.

These are the mistakes almost every beginner makes with bool. At least once.

Mistake 1 — Lowercase true and false

# Wrong — NameError
is_valid = true
is_valid = false

# Right
is_valid = True
is_valid = False

True and False are capitalized. Always. Python is case sensitive.

Mistake 2 — Using = instead of ==

age = 20

# Wrong — this assigns 20, not compares
if age = 20:   # SyntaxError

# Right
if age == 20:  # compares age to 20

= assigns. == compares. They are not interchangeable.

Mistake 3 — Comparing bools unnecessarily

is_valid = True

# Wrong — redundant
print(is_valid == True)   # True, but unnecessary

# Right
print(is_valid)           # True — cleaner

A bool is already True or False. You don't need to compare it to itself.

Mistake 4 — Confusing and with or

is_student = False
is_senior = False

# Wrong — expecting False but thinking "one of them"
print(is_student and is_senior)   # False — correct, but for wrong reasons

is_student = True
is_senior = False

# This is where it breaks
print(is_student and is_senior)   # False — both must be True
print(is_student or is_senior)    # True — at least one is True

Use and when ALL conditions must be true. Use or when ANY condition can be true.

Mistake 5 — not not

is_banned = False

print(not is_banned)        # True — correct
print(not not is_banned)    # False — double negative, confusing

Double negatives work in Python but they're confusing. If you find yourself writing not not, rethink the logic.

Mistake 6 — Case sensitivity with in

name = "Bull"

print("bull" in name)           # False — case sensitive
print("Bull" in name)           # True

# Fix — normalize before checking
print("bull" in name.lower())   # True

in is case sensitive. Always normalize if you're not sure about the case.

What's really happening

Most bool mistakes come from assumptions — about capitalization, about operators, about logic.

Python is precise. Say exactly what you mean.

The mindset shift

Stop thinking: "True is true, however I write it."

Start thinking: "Python has exact rules. Follow them exactly."

What you should understand now

  • True and False are capitalized — always
  • = assigns, == compares — never confuse them
  • Don't compare a bool to True — just use the bool
  • and need
[ login to bookmark ] // copied! 37 views · 2 min
// resources
Other bool_mistakes.py
← prev Your Fourth Mini Project — Lock It Down next → Bools — The Full Picture
// 0 comments
// No comments yet. Be the first.
// leave a comment

// Your comment will appear after approval.