三元表达式 2022-11-08 本文已影响0人 Q_Mia 条件为真时返回结果 if 判断条件 else 条件为假时返回结果 x = 1 y = 2 print(x if x > y else y) print(x-y if x > y else x+y)