day04_05 逻辑运算符、表达式

num += 1 等价于 num = num + 1

逻辑运算符

and   全true则true

条件1 and 条件2

5>3 and 3>2   ===> true

5>3 and 3<2   ===>false

 

or  有true则true

5>3 or 6<2   ===>true

 

not 取反

not 5>3 ===>false

not 5<3 ===>true

 

a>b and c>d or not f

判断优先级:最好加括号

not > and > or

 

posted on 2017-09-06 23:43  darkalex001  阅读(133)  评论(0编辑  收藏  举报

导航