python 位运算符与逻辑运算符(字符串的逻辑运算)
2016-01-09 21:54
696 查看
注意区别位运算符和逻辑运算符;
位运算符(按位操作):
与运算,&
或运算,|
非(取反)运算,~
异或,^
左移,<<, 5<<2==5×22
右移,>>, 5>>2==5/22==1
逻辑运算符:
与:and
或:or
非:not
位运算符(按位操作):
与运算,&
或运算,|
非(取反)运算,~
异或,^
左移,<<, 5<<2==5×22
右移,>>, 5>>2==5/22==1
逻辑运算符:
与:and
或:or
非:not
1. 字符串的逻辑运算
>> 'zhang' or 'wang' 'zhang' >> None or 'zhang' 'zhang'
with tf.name_scope(scope or 'linear'):
相关文章推荐
- 比较Python和Perl的效率
- leetcode之Reverse Linked List II
- Python中安装以及配置easy_install
- [python语法巩固][leetcode326][Power of Three]
- [python语法巩固][leetcode326][Power of Three]
- python numpy:1 numpy.array和numpy.matrix常用函数使用
- 快速打造跨平台开发环境 vagrant + virtualbox + box
- 菜鸟学python(7) 简单文件访问
- 菜鸟学python(6) for语句
- Selenium+Python Radio,Checkbox,Link,ComboBox控件
- Python修改当前工作目录
- leetcode之Partition List
- python中利用exec动态创建函数
- python学习--------随机验证码生成
- python项目之 天气 优化版
- 如何更改Ipython Notebook默认路径
- Python 2.5.4 生成器
- python项目之 天气程序 带GUI
- Python入门知识总结
- caffe中cuda7.5的配置及python接口的使用--ubuntu14.04