码迷,mamicode.com
首页 > 编程语言 > 详细

python | 运算符 | 逻辑运算符

时间:2018-01-13 20:53:39      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:encoding   none   color   逻辑运算   int   pre   gpo   and   col   

 1 # encoding: utf-8
 2 
 3 # None与0都为False
 4 print(bool(None))
 5 print(bool(0))
 6 
 7 # 短路运算符规则
 8 # 假与取左
 9 print(0 and 90)
10 
11 # 真或取左
12 print(90 or 43)
13 
14 # 假或取右
15 print(0 or 78)
16 
17 # 真与取右
18 print(78 and 89)

 

python | 运算符 | 逻辑运算符

标签:encoding   none   color   逻辑运算   int   pre   gpo   and   col   

原文地址:https://www.cnblogs.com/yuzhen233/p/8280207.html

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