C:\Users\Administrator>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a,b,c=1,3,5
>>> d = a if a > b else c
>>> d
5
>>> d = a if a < b else c
>>> d
1
>>>

posted on 2017-01-04 15:57  Python哥  阅读(121)  评论(0编辑  收藏  举报