if runs a block of code only when a condition is True. The line ends with a colon, and the block under it's indented by 4 spaces:
if hours_open > 24:
status = "late"
elif hours_open > 8:
status = "due soon"
else:
status = "on time"
Python checks the conditions from the top and runs the first block whose condition is true, then skips the rest. So the order matters: put the strictest test first.
To compare, use == (equal; a single = stores a value), !=, <, <=, > and >=. Combine conditions with and, or and not. Python reads ranges the way you'd write them: 1 <= weight < 5.
For a simple either-or value there's a one-line form: fee = 0 if is_member else 4.99.