python语法技巧

三元表达式

1 a=100
2 b=5
3 res= a if a>b else b
4 print(res)
5 #res=100

 

posted @ 2017-05-18 14:35  尖锐小刻刀  阅读(122)  评论(0编辑  收藏  举报