Use Python's conditional expression to choose between two values, and show what happens when the condition is not a plain boolean.
Python's conditional expression, which is often called the ternary operator, is a single expression that picks one of two values. The order of the parts is the reverse of the C ternary, so it reads as value_if_true if condition else value_if_false.
age = 20
status = 'adult' if age >= 18 else 'minor'
print(status) # adult
# The condition does not have to be a bool, because truthiness decides.
name = ''
label = 'anonymous' if not name else name
print(label) # anonymous
# Any expression is allowed on either side.
cart = ['book']
message = 'you have items' if cart else 'your cart is empty'
print(message) # you have items
# It is an expression, so you can use it inline.
print('paid' if status == 'adult' else 'unpaid')
The important property is that it is an expression and not a statement, which means that it produces a value and it can appear anywhere a value can appear. You can use it inside a call, on the right-hand side of an assignment, in a return statement, or nested inside another conditional expression.
There are two habits to warn against. The first one is that the order is easy to get backwards. Writing 'adult' if status else 'minor' tests the wrong thing, because status is a non-empty string and is therefore always truthy. The second one is the classic trap of writing value = a or b, which is not the same as a if a else b. The or form returns a whenever a is truthy, even when a is not the value you meant, whereas the conditional expression tests a directly and returns b only when a is falsy.
There is some style guidance worth repeating. Keep a conditional expression on one line and keep it short. If it needs brackets and a line break, then an if and else block is clearer.