标签:zip fun 迭代 映射 依次 pre epc hal 输入
数据进行绑定到一起
a = [1, 2, 3]
b = [4, 5, 6]
c = [7, 8, 9]
for k, v, v2 in zip(a, b, c):
print(k, v, v2)
lambda
进行输入 :输出简化map
传入函数和可迭代对象可以进行依次进行映射执行fun = lambda x, y, z: x + y + z
print(list(map(fun, a, b, c)))
import copy
a = [1, 2, [1, 2]]
b = copy.deepcopy(a) # deep copy
c = copy.copy(a) # shallow copy
print(id(a) == id(b))
print(a == b)
print(id(a[2]) == id(b[2]))
print(a)
print(b)
Python (zip, lambda, map, shallow copy, deepcopy)
标签:zip fun 迭代 映射 依次 pre epc hal 输入
原文地址:https://www.cnblogs.com/littlepage/p/12493274.html