列表Ⅱ
>>> s =>>> # 下面的做法等同于 s.append(6)
>>> s =
>>> s
>>> s =
>>> s
>>> a =
>>> a.insert(1, 2)
>>> a
>>> heros = ["金刚", "灭霸", "雷神"]
>>> heros.remove("灭霸")
>>> heros
['金刚', '雷神']
>>> # 列表中存在多个匹配的元素,那么它只会删除第一个
>>> heros
['金刚', '雷神']
>>> heros.pop(1)
'雷神'
>>> heros
['金刚']
>>> heros.clear()
>>> heros
[]
页:
[1]