条件语句
1.
>>> a = 3
>>> b = 4
>>> c = a if a < b else b
>>> print(c)
3
2.
>>> m=4
>>> n=2
>>> ('n', 'm')[m > n]
'm'
实质是索引的使用
3.
>>> m = 4
>>> n = 5
>>> m > n and m or n
5
实质是与或运算
标签:语句,表达,else,实质,条件,print,n5
来源: https://www.cnblogs.com/lensman/p/15701989.html