Python 运算符
2019-05-08 本文已影响0人
南山关小北
什么是运算符?
举个简单的例子 4 +5 = 9 。 例子中,4 和 5 被称为操作数,"+" 称为运算符。
Python语言支持以下类型的运算符:
算术运算符
比较运算符
赋值运算符
逻辑运算符
位运算符
成员运算符
身份运算符
运算符优先级
一 Python算术运算符
以下假设变量: a=10,b=20:

二 Python比较运算符

三 Python赋值运算符

四 Python位运算符
五 Python逻辑运算符

六 Python成员运算符
Python还支持成员运算符,测试实例中包含了一系列的成员,包括字符串,列表或元组。

七 Python身份运算符

八 Python运算符优先级
