python更新列表的方法
更新時間:2015年07月28日 10:17:21 作者:pythoner
這篇文章主要介紹了python更新列表的方法,實例分析了Python列表賦值的相關技巧,需要的朋友可以參考下
本文實例講述了python更新列表的方法。分享給大家供大家參考。具體如下:
aList = [123, 'abc', 4.56, ['inner', 'list'], (7-9j)] print aList[2] aList[2] = 'float replacer' print aList aList.append("hi, i'm new here") print aList
運行結果如下:
4.56 [123, 'abc', 'float replacer', ['inner', 'list'], (7-9j)] [123, 'abc', 'float replacer', ['inner', 'list'], (7-9j), "hi, i'm new here"]
希望本文所述對大家的Python程序設計有所幫助。
您可能感興趣的文章:
- python創(chuàng)建列表并給列表賦初始值的方法
- Python中使用copy模塊實現(xiàn)列表(list)拷貝
- 詳解Python中列表和元祖的使用方法
- Python操作列表之List.insert()方法的使用
- 在Python中操作列表之List.pop()方法的使用
- 在Python中處理列表之reverse()方法的使用教程
- 在Python中操作列表之List.append()方法的使用
- 在Python中操作列表之list.extend()方法的使用
- 在Python的列表中利用remove()方法刪除元素的教程
- python刪除列表內容
- python 的列表遍歷刪除實現(xiàn)代碼
- Python編程之列表操作實例詳解【創(chuàng)建、使用、更新、刪除】