这里是list对象的所有方法:
- list.append(x)
-
[x]。
- list.extend(L)
-
L。
- list.insert(i, x)
-
a.append(x)。
- list.remove(x)
-
如果没有这样的元素将会报错。
- list.pop([i])
-
你会在 Python 参考库中经常看到这种表示法)。
- list.index(x)
-
如果没有这样的元素将会报错。
- list.count(x)
-
返回列表中 x 出现的次数。
- list.sort(cmp=None, key=None, reverse=False)
-
sorted()的更详细的解释)。
- list.reverse()
-
原地反转列表中的元素。