三元表达式 一、三元表达式 一、三元表达式 条件成立时的返回值 / if 条件 / else 条件 / 不成立时的返回值 x = 10 y = 20 print(f"x if x > y else y: {x if x > y else y}") x if x > y else y: 20