Python:三元运算时间:2023-03-09 05:39:34 result=值1 if 条件 else 值2 如果条件为真,result=值1 如果条件为假,result=值2 例子: a,b,c=1,3,5 d=a if a>b else c print(d) #d的值为5