列表(list) 赋值方法: l = [11,45,67,34,89,23] l = list() 列表的方法: #!/usr/bin/env python class list(object): """ list() -> new empty list list(iterable) -> new list initialized from iterable's items """ def append(self, p_object)…
列表(集合list)的基本操作: # 列表的常见操作 nameList = ["张学友", "刘德华", "郭富城", "黎明"] # 循环列表 for name in nameList: print(name) print("*****************************") i = 0 while i < len(nameList): print(nameList[i]) i += 1…
# 双层循环 temp = list() for i in range(1,100): item = {} itme["a"] = i for j in range(1,100): item["b"] = j temp.append(item) # 字典的键和值覆盖,导致数据值存储最后一次循环的结果 # TODO…