操作符
1、标准类型操作符
>>> list1=["abc",123]
>>> list2=["xyz",789]
>>> list3=["abc",123]
>>> list1<list2
True
>>> list2<list3
False
>>> list2>list3 and list1==list3
True
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1f3e22880e33a3c44dc1892a4c50075a.png)
2、序列类型操作符切片[]和[:]
>>> num_list=[43,-1.23,-2,6.19e5]
>>> str_list=["jack","jumped","over","candlestick"]
>>> mixup_list=[4.0,[1,"x"],"beef",-1.9+6j]
>>> num_list[1]
-1.23
>>> num_list[1:]
[-1.23, -2, 619000.0]
>>> num_list[2:-1]
[-2]
>>> str_list[2]
'over'
>>> str_list[:2]
['jack', 'jumped']
>>> mixup_list
[4.0, [1, 'x'], 'beef', (-1.9+6j)]
>>> mixup_list[1]
[1, 'x']
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a6c5b08788f82821fa23fea2036d8613.png)
>>> num_list=[43,-1.23,-2,6.19e5]
>>> str_list=["jack","jumped","over","candlestick"]
>>> mixup_list=[4.0,[1,"x"],"beef",-1.9+6j]
>>> mixup_list[1][1]
'x'
>>> mixup_list[1][1]=-64.875
>>>
>>> mixup_list
[4.0, [1, -64.875], 'beef', (-1.9+6j)]
>>> num_list
[43, -1.23, -2, 619000.0]
>>> num_list[2:4]
[-2, 619000.0]
>>> num_list[2:4]=[16.0,-49]
>>> num_list
[43, -1.23, 16.0, -49]
>>> num_list[0]=[65535,2e30,76.45-1.3j]
>>> num_list
[[65535, 2e+30, (76.45-1.3j)], -1.23, 16.0, -49]
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f0e856c6f45a88c96b46c38b918c6cad.png)
3、成员关系in、not in
>>> mixup_list
[4.0, [1, -64.875], 'beef', (-1.9+6j)]
>>> "beef" in mixup_list
True
>>> "x" in mixup_list
False
>>> mixup_list[1][1]="x"
>>> mixup_list[1][1]
'x'
>>> mixup_list
[4.0, [1, 'x'], 'beef', (-1.9+6j)]
>>> "x" in mixup_list[1]
True
>>> num_list
[[65535, 2e+30, (76.45-1.3j)], -1.23, 16.0, -49]
>>> -49 in num_list
True
>>> 34 in num_list
False
>>> [65535, 2e+30, (76.45-1.3j)] in num_list
True
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ca5091c1a8f22ed6a137fbd19be629e6.png)
4、链接操作符
>>> num_list
[[65535, 2e+30, (76.45-1.3j)], -1.23, 16.0, -49]
>>> str_list
['jack', 'jumped', 'over', 'candlestick']
>>> mixup_list
[4.0, [1, 'x'], 'beef', (-1.9+6j)]
>>> num_list + mixup_list
[[65535, 2e+30, (76.45-1.3j)], -1.23, 16.0, -49, 4.0, [1, 'x'], 'beef', (-1.9+6j)]
>>> str