如下所示:
list1 = [a, b, 1, 2];
list2 = [1, 2, 3, 4, 5 ];
list3 = ["a", "b", "c", "d"];
索引
与字符串的索引一样,列表索引从...Python包含以下函数:
序号 函数
1 len(list)列表元素个数
2 max(list)返回列表元素最大值
3 min(list)返回列表元素最小值
4 list(seq)将元组转换为列表...在列表末尾一次性追加另一个序列中的多个值(用新列表扩展原来的列表)
4 list.index(obj)从列表中找出某个值第一个匹配项的索引位置
5 list.insert(index, obj)将对象插入列表...,如果变量是字典就返回字典类型。...in dict如果键在字典dict里返回true,否则返回false
6 radiansdict.items()以列表返回可遍历的(键, 值) 元组数组
7 radiansdict.keys()返回一个迭代器