列表的运算
+ += * *=
列表的比较运算:
< <= > >= != ==
+ 举例:
>>> [1,2,3,] + [4,5,6]
[1, 2, 3, 4, 5, 6]
>>> [4,5,6] + [1,2,3] # 两个数列相加有 方向.
[4, 5, 6, 1, 2, 3]
>>> 1+2
3
>>> 2+1 # 两个数字相加无方向.
3
>>>
+=
运算符的右边,为可迭代对象.
* * =
与字符串的相同,
>>> [1,2,3,] + [4,5,6]
[1, 2, 3, 4, 5, 6]
>>> [4,5,6] + [1,2,3] # 两个数列相加有 方向.
[4, 5, 6, 1, 2, 3]
>>> 1+2
3
>>> 2+1 # 两个数字相加无方向.
3
>>>
运算符的右边,为可迭代对象.
与字符串的相同,