Day 6 of 30Python Foundations
✅Booleans & Comparisons
🎯 Today's objective
Ask yes/no questions in code — the basis of decisions.
📖 Key concepts
- Booleans: True / False
- Comparisons: == != > < >= <=
- Logic: and, or, not
- == compares, = assigns
💻 Try this code
marks = 72
print(marks >= 40) # True
print(marks > 90 or marks < 50)
print(not (marks == 100))👥 Learn it your way
🧒 Young Explorers
A boolean is a light switch: on (True) or off (False).
Your task
Print whether a number you choose is both positive AND even.
💼 Professionals
Mind truthiness (0, "", [] are falsy) and short-circuit evaluation in and/or.
Your task
Given age and a has_id flag, compute can_enter = age >= 18 and has_id.
🤖 AI connection
Machines "decide" by evaluating conditions. Classifiers ultimately output something like "is this a cat? True/False" from learned thresholds.
✅ Quick check
Difference between = and ==?
= assigns a value; == checks equality.
What is `True and False`?
False