list.append():方法用於在列表末尾添加新的對象;
該方法沒有返回值,但是會修改原來的列表;
格式如下:listname.append(object)
listname:操作的列表名
append():使用的方法
object:添加的對象
實例如下:
list1=[1,2,3,4,5,6] print(list1) list1.append(10) print(list1)
#輸出
[1, 2, 3, 4, 5, 6]
[1, 2, 3, 4, 5, 6, 10]
進程已結束,退出代碼為 0