1.member = ["zdz","liufeng","hots"]
2.number = [1,2,3]
,
[]
[1, 'zdz', 3.12, [1, 2, 3]]
['zdz', 'liufeng', 'hots', 'good']
['zdz', 'liufeng', 'hots', 'good', 'cnblogs', 'google']
['alex', 'zdz', 'liufeng', 'hots', 'good', 'cnblogs', 'google']
['zdz', 'alex', 'liufeng', 'hots', 'good', 'cnblogs', 'google']
['zdz', 'alex', 'liufeng', 'hots', 'cnblogs', 'google']
['zdz', 'alex', 'hots', 'cnblogs', 'google']
['zdz', 'alex', 'hots', 'cnblogs']
['zdz', 'alex', 'cnblogs']
-----列表分片/切片 slice-----
['zdz', 'alex', 'cnblogs', 'hello']
['alex', 'cnblogs']
['zdz', 'alex', 'cnblogs', 'hello']
['zdz', 'alex', 'cnblogs']
['alex', 'cnblogs', 'hello']
['zdz', 'alex', 'cnblogs', 'hello']
-----列表常用操作符-----
False
False
True
True
False
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
[123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456]
4
[456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123, 456, 123]
[4, 2, 5, 7, 9, 12, 35, 1]
[1, 2, 4, 5, 7, 9, 12, 35]
[1, 2, 4, 5, 7, 9, 12, 35]
[4, 2, 5, 7, 9, 12, 35, 1]
[35, 12, 9, 7, 5, 4, 2, 1]
[35, 12, 9, 7, 5, 4, 2, 1]
>>>
更多Python相关内容感兴趣的读者可查看本站专题:《Python列表(list)操作技巧总结》、《Python编码操作技巧总结》、《Python数据结构与算法教程》、《Python函数使用技巧总结》、《Python字符串操作技巧汇总》、《Python入门与进阶经典教程》及《Python数组操作技巧总结》