Most of the time when I see python ternary in the wild, it makes the code less readable, not more. Why not just define something like this if you want oneliners?
def if_then_else(cond, true_case, false_case):
if cond:
return true_case
return false_case
x = if_then_else(condition, 4, 5)