python中有一种特殊的语法
a=10
b= 20
1 and a or b
这个时候我们看的值是 1 and a到底是 true还是false,如果是true ,那么最终的结果就是a
所以这个的结果为 10
同样的
0 and a or b
结果为20
Latest posts by Zhiming Zhang (see all)
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021
- Index brackets must contain either a literal number or a literal string.terraform taint - 5月 20, 2021