Python List remove()方法
Python 教程
· 2019-02-02 22:42:39
描述
remove() 函数用于移除列表中某个值的第一个匹配项。
语法
remove()方法语法:
list.remove(obj)
参数
- obj -- 列表中要移除的对象。
返回值
该方法没有返回值但是会移除列表中的某个值的第一个匹配项。
实例
以下实例展示了 remove()函数的使用方法:
#!/usr/bin/python
aList = [123, 'xyz', 'zara', 'abc', 'xyz'];
aList.remove('xyz');
print "List : ", aList;
aList.remove('abc');
print "List : ", aList;
以上实例输出结果如下:
List : [123, 'zara', 'abc', 'xyz'] List : [123, 'zara', 'xyz']
点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html
Web Operations
John Allspaw、Jesse Robbins / O'Reilly Media / 2010-6-28 / USD 39.99
A web application involves many specialists, but it takes people in web ops to ensure that everything works together throughout an application's lifetime. It's the expertise you need when your start-u......一起来看看 《Web Operations》 这本书的介绍吧!
RGB HSV 转换
RGB HSV 互转工具
RGB CMYK 转换工具
RGB CMYK 互转工具