Python三目运算符

result=x if x<y else y

这种方式,简单直观。