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)
- aws eks node 自动化扩展工具 Karpenter - 8月 10, 2022
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021