Using the billing summary from yesterday — when do you know a project has gone over scope before you send the invoice?
When the hours field exceeds what I quoted. I eyeball it manually. Sometimes I don't notice until after I send and the client pushes back.
Python's > operator is that eyeball, automated. actual > budgeted returns True or False — a bool. No manual scanning: the function flags the project the moment it crosses the line. One comparison, one return, zero missed projects:
actual = 6.0
budgeted = 5.0
over = actual > budgeted # True
print(f"Over hours: {over}")So True and False are actual Python values, not just words I print? I can store them in a variable?
Exactly. bool is a type, like str and float. You store it, pass it to another function, or use it in an if statement. actual > budgeted is an expression that evaluates to True or False — the result is a first-class value. The == at the boundary is the classic trap:
is_over_hours(5.0, 5.0) # False — strictly greater than
is_over_hours(5.1, 5.0) # TrueSo next week when I loop over six clients I can filter the over-hours ones with this function.
That is exactly Week 2. Flag them today, filter them tomorrow.
I have been catching scope creep by eye for years. One comparison operator is all it needed.
The boundary matters: > not >=. Being exactly at budget is on track. A scope conversation triggers the moment you exceed it, not the moment you hit it.
Six comparison operators return True or False:
| Operator | Meaning | Example |
|---|---|---|
> | strictly greater than | 6.0 > 5.0 → True |
>= | greater than or equal | 5.0 >= 5.0 → True |
== | equal | 5.0 == 5.0 → True |
!= | not equal | 5.0 != 6.0 → True |
True and False are values you can store, pass, and return. if is_over_hours(actual, budgeted): reads cleanly in Week 2 loops.
Using the billing summary from yesterday — when do you know a project has gone over scope before you send the invoice?
When the hours field exceeds what I quoted. I eyeball it manually. Sometimes I don't notice until after I send and the client pushes back.
Python's > operator is that eyeball, automated. actual > budgeted returns True or False — a bool. No manual scanning: the function flags the project the moment it crosses the line. One comparison, one return, zero missed projects:
actual = 6.0
budgeted = 5.0
over = actual > budgeted # True
print(f"Over hours: {over}")So True and False are actual Python values, not just words I print? I can store them in a variable?
Exactly. bool is a type, like str and float. You store it, pass it to another function, or use it in an if statement. actual > budgeted is an expression that evaluates to True or False — the result is a first-class value. The == at the boundary is the classic trap:
is_over_hours(5.0, 5.0) # False — strictly greater than
is_over_hours(5.1, 5.0) # TrueSo next week when I loop over six clients I can filter the over-hours ones with this function.
That is exactly Week 2. Flag them today, filter them tomorrow.
I have been catching scope creep by eye for years. One comparison operator is all it needed.
The boundary matters: > not >=. Being exactly at budget is on track. A scope conversation triggers the moment you exceed it, not the moment you hit it.
Six comparison operators return True or False:
| Operator | Meaning | Example |
|---|---|---|
> | strictly greater than | 6.0 > 5.0 → True |
>= | greater than or equal | 5.0 >= 5.0 → True |
== | equal | 5.0 == 5.0 → True |
!= | not equal | 5.0 != 6.0 → True |
True and False are values you can store, pass, and return. if is_over_hours(actual, budgeted): reads cleanly in Week 2 loops.
Theo quotes a fixed number of hours per project and needs an automatic flag the moment actual hours exceed the budget — before the invoice goes out. Write `is_over_hours(actual, budgeted)` that returns `True` if actual hours strictly exceed budgeted hours, and `False` otherwise.
Tap each step for scaffolded hints.
No blank-editor panic.