Python-杂物

1,and和or

在一个bool and a or b语句中,当bool条件为真时,结果是a;当bool条件为假时,结果是b。

a = "heaven"

b = "hell"

c = True and a or b

print c

d = False and a or b

print d

输出:

heaven

hell

2,

原文地址:https://www.cnblogs.com/two-peanuts/p/10032670.html