team470 发表于 2017-5-1 06:37:09

python boolean opeator优先级

  1.有三个布尔操作:
  not, and, or
  2. 优先级

[*]notisevaluated first;
[*]andisevaluated next;
[*]orisevaluated last.
3. 通过加( )可以改变计算顺序  例子:
  1. 在console输入:
  not not True or False and not True

  输出是:True
  2. 在console输入:
  (not not True or False) and not True

  输出是:False



  

  
页: [1]
查看完整版本: python boolean opeator优先级