python-append()方法

append() 方法向列表的尾部添加一个新的元素。只接受一个参数。

>>> mylist = [1,2,3,4]
>>> mylist
[1, 2, 3, 4]
>>> mylist.append(5)
>>> mylist
[1, 2, 3, 4, 5]
>>> mylist.append('test')
>>> mylist
[1, 2, 3, 4, 5, 'test']
>>> 
原文地址:https://www.cnblogs.com/tdcqma/p/5249559.html