def newzip(*args):
result = []
if len(args) > 0:
lens = list(map(len, args))
maxL = max(lens)
for i in range(maxL):
temp = []
for j in args:
if i < len(j):
temp.append(j[i])
else:
temp.append(None)
result.append(temp)
return result
print(newzip([1, 2], ['a', 'b', ('c', 'd')]))
print(newzip([1,2],[3, 4],[5, 6, 7]))
3024

被折叠的 条评论
为什么被折叠?



