[python]python三元表达式另类实现方式

(1) variable = a if exper else b
(2)variable = (exper and [b] or [c])[0]
(2) variable = exper and b or c 

 

posted @ 2015-06-11 16:05  风痕影默  阅读(432)  评论(0编辑  收藏  举报
友情链接:极限BT