python里if/ else的简写

Posted on 2021-02-02 17:15  猫头唔食鱼  阅读(2506)  评论(0编辑  收藏  举报

python里面没有三元表达式,所以,采取下面的简写方式:

return a  if true  else b