码迷,mamicode.com
首页 > 其他好文 > 详细

day04_05 逻辑运算符、表达式

时间:2017-09-07 00:49:03      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:and   img   log   表达   取反   最好   alt   分享   col   

技术分享

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 逻辑运算符、表达式

标签:and   img   log   表达   取反   最好   alt   分享   col   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!