python中列表的连接操作符、重复操作符、成员关系操作符
python中列表的连接操作符、重复操作符、成员关系操作符。
1、连接操作符,相当于列表对象extend
>>> test1 = ["aa","bb"]
>>> test1
['aa', 'bb']
>>> test2 = ["cc","dd"]
>>> test2
['cc', 'dd']
>>> test1 + test2
['aa', 'bb', 'cc', 'dd']
2、重复操作符
>>> test1
['aa', 'bb']
>>> test1 * 3
['aa', 'bb', 'aa', 'bb', 'aa', 'bb']
3、成员关系操作符
>>> test1
['aa', 'bb']
>>> "aa" in test1
True
>>> "xx" in test1
False
>>> "aa" not in test1
False
>>> "xx" not in test1
True