[python]python三元表示式另類實現方式

風痕影默發表於2015-06-11
(1) variable = a if exper else b
(2)variable = (exper and [b] or [c])[0]
(2) variable = exper and b or c 

 

相關文章