Python List append()方法
生活随笔
收集整理的這篇文章主要介紹了
Python List append()方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
append() 方法用于在列表末尾添加新的對象。
Grammar:
list.append(obj)
參數
obj — 添加到列表末尾的對象。
返回值
該方法無返回值,但是會修改原來的列表。
Case:
1 alist=[123,'abc']; 2 alist.append(2020); 3 print "new list : ",alist;
Output:
?1 new list : [123, 'abc', 2020]?
quote:http://www.runoob.com/python/att-list-append.html
轉載于:https://www.cnblogs.com/sub2020/p/7856069.html
總結
以上是生活随笔為你收集整理的Python List append()方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 洱海私家车可以进去吗
- 下一篇: 想做试管婴儿怎么预约