Python 三目运算符

 

 cookbook 中有

 

 等价于

 

 解释:如果tail 存在 ture 返回 head +sum(tail),否则返回 head

posted @ 2019-11-15 14:27  jescs  阅读(192)  评论(0)    收藏  举报