赞
踩
list.remove(item)
item
: 准备删除的列表元素In [31]: drinks = ['雪碧','可乐','矿泉水']
In [32]: drinks.remove('矿泉水')
In [33]: drinks
Out[33]: ['雪碧','可乐']
In [34]: drinks =['雪碧','可乐','矿泉水']
In [35]: del drinks
In [36]: print(drinks)
NameError Traceback (most recent call last)
<ipython-input-36-75a320
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。