三目运算

点击查看代码
*值1 if  条件 else 值2
a = 10
b = 99
max = a if a > b else b
print(max)

posted @ 2024-09-13 10:32  神仙不在  阅读(8)  评论(0)    收藏  举报