python 三元运算符

print (1==2) and 12 or 4

b=12 if 1==2 else 4
print(b)

posted @ 2016-10-28 16:52  howhy  阅读(1066)  评论(0编辑  收藏  举报