,从0开始,类似数组的下标,可以利用索引实现随机存取和更改。...Traceback (most recent call last):
File "", line 1, in
IndexError: list index out of...range
#事实上,最后一行英文的翻译为:索引错误: list索引超出范围。...] “*” 实际上是复制
3 in [1, 2, 3, 4] True 检查成员是否存在
for i in [1, 2, 3, 4] print(x) 1 2 3 4 迭代
Python list 函数...&方法
Python内置以下操作list的函数:
函数 说明
cmp(list1, list2) 比较两个列表的元素,比较方法与其他语言字符串的比较相同。