首页 > 其他 > 详细

day04_05 逻辑运算符、表达式

时间:2017-09-07 00:38:32      阅读:347      评论:0      收藏:0      [点我收藏+]

技术分享

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

技术分享

 

day04_05 逻辑运算符、表达式

原文:http://www.cnblogs.com/darkalex001/p/7487681.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!