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,

猜你喜欢

转载自blog.csdn.net/weixin_40430845/article/details/79059494