Python-杂物

Posted puppet洛洛

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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,

以上是关于Python-杂物的主要内容,如果未能解决你的问题,请参考以下文章