append在python里是什么
append在python里是什么?
python里append()方法用于在列表末尾添加新的对象。
append()方法语法:
list.append(obj)
参数
obj -- 添加到列表末尾的对象。
返回值
该方法无返回值,但是会修改原来的列表。
实例
以下实例展示了 append()函数的使用方法:
#!/usr/bin/python aList = [123, 'xyz', 'zara', 'abc']; aList.append( 2009 ); print "Updated List : ", aList;
以上实例输出结果如下:
Updated List : [123, 'xyz', 'zara', 'abc', 2009]
相关推荐:《Python教程》
以上就是append在python里是什么的详细内容,更多请关注jquery中文网其它相关文章!
您可能感兴趣的文章:
append在python里是什么
python中extend是什么意思
python的append是什么意思
谈谈Python中对象拷贝
python setup.py install是什么意思
python怎么对列表中元素去重复
python中r代表什么意思
python正则表达式r表示什么意思
python用的是什么语言写的
python里print是什么意思