数据运算+-*/,比较运算符==!=,赋值运算,逻辑运算and,or,not,成员运算in,not in,身份运算is is not,位运算&|,运算符的优先级
2017-08-08 20:35
609 查看
取模就是返回余数。
取模的作用主要是来取奇偶数来用的,奇数干嘛,偶数干嘛。
比较运算符:
赋值运算:
逻辑运算:
赋值的时候可以多个变量同时赋值
成员运算:
in就是在不在的意思。
身份运算:
位运算:
二进制运算:
&就是and运算
|或运算就是or
异或运算就是^,正好相反,相同为0,不通为1
按位取反运算~,取60的按位取反,就是0变成1,1变成0
所以~60=195,但是实际情况呢得到-61,都是负值
因为计算机都是按195-256=-61得到的值显示的负值
左移右移的应用场景
右移一位相当于除以2,右移两位相当于除以4
左移一位相当于乘以2,左移2位相当于乘以4,左移10位,相当于乘以2的10次方
移动几位相当于除以或者乘以2的几次方
运算符的优先级:
相关文章推荐
- 【再回首Python之美】【逻辑运算】七个逻辑运算符:not, or, and, not or, not and, !=, ==
- Python 运算符(算数 比较 赋值 位 逻辑 成员 身份 优先级)
- [汇编]逻辑运算 => AND,OR,XOR,NOT
- Mysql| 组合where子句过滤数据(AND,OR,IN,NOT)
- Win32 汇编 - 逻辑运算指令: AND、OR、XOR、NOT、TEST
- Python 运算符(算术运算符(+,-,*,**,/,//),逻辑运算符(not , or ,and),比较运算符(>,<,>=,=<),复合运算符(+=,-=,*=,/=,**=,//=))
- 07 数据过滤 - and、or、not、in
- MySQL学习足迹记录05--数据过滤--AND,OR,NOT,IN
- SQL---DML---WHERE过滤数据のAND,OR,IN,NOT的高级过滤
- lua 逻辑运算 and, or, not【转】
- 逻辑 与 或 非的优先级(and or not 优先级)
- 学 Win32 汇编[22] - 逻辑运算指令: AND、OR、XOR、NOT、TEST
- 逻辑运算 NOT\AND\OR\XOR\TEST
- Could not find action or result:There is no Action mapped for namespace / and action name
- Docker安装MySQL遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题
- UserWarning: The installed version of numexpr 2.4 is not supported in pandas and will be not be used
- 异常:Absent Code attribute in method that is not native or abstract in class
- oracle中逻辑运算符(not,and,or)及其优先级
- How to fix the issue that GEM_HOME and/or GEM_PATH not set issue for rvm in mac version 10.12
- javascript in运算符 真值和假值 赋值运算 表达式计算 delete运算符号 二十