python三元运算

Python三元运算表达式

  表达式格式

为真时的结果 if 判定条件 else 为假时的结果 

  事例

1 if 3>2 else 0

  结果为: 1

原文地址:https://www.cnblogs.com/bigberg/p/7798361.html