我想知道,是否有办法加快此处显示的功能。我知道这看起来不是很蟒蛇......
def MakePairs(inputlist):
'''
@param inputlist: [[["a","b","c"],["d","e","f"]],[["g","h","i"],["j","k","l"]],...]
@return returnlist: [[["a","d"],["b","e],["c","f"]],[["g","j"],["h","k"],["i","l"]],...]
'''
returnlist = []
for Pair in xrange(len(inputlist)):
dummy2 = []
for item in xrange(len(inputlist[Pair][0])):
dummy = [Pair[0][item], Pair[1][item]]
dummy2.append(dummy)
returnlist.append(dummy2)
return returnlist
编辑:退货清单中的对必须是清单。
提前致谢!!!