标签:http ar sp on bs html ef 时间 tt
今天查if-else的时候发现了下面这篇文章,2、3之前都没见过,4花了一段时间才看明白(Tips:short circuit)
1.常规
if a>b:
c = a
else:
c = b
2.表达式
c = a if a>b else b
3.二维列表
c = [b,a][a>b]
4.传说是源自某个黑客
c = (a>b and [a] or [b])[0]
标签:http ar sp on bs html ef 时间 tt
原文地址:http://www.cnblogs.com/duqf/p/4142554.html