Python三目运算

  result  =  值1 if 条件 else 值2

  e.g.

  a,b,c = 1,3,5

  d = a if a > b else c

  结果:d = 5

posted @ 2017-12-26 20:20  NiGuard  阅读(129)  评论(0)    收藏  举报