python更新列表的方法
时间:2021-11-05 09:22:58|栏目: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程序设计有所帮助。
上一篇:详解mac python+selenium+Chrome 简单案例
栏 目:Python代码
下一篇:python实现电子词典
本文标题:python更新列表的方法
本文地址:http://www.codeinn.net/misctech/182524.html






