我有两份清单:
indexList = [5,3,2,2,7,1]
valueList = [1,2,3,4,5,6]
我想将这两种类型组合起来,以便输出如下:
indexList = [1,2,2,3,5,7]
valueList = [6,3,4,2,1,5]
然后,我要将缺失的索引及其相应的值填写为"0":
indexList = [1,2,2,3,4,5,6,7]
valueList = [6,3,4,2,0,1,0,5]
最后,我要删除重复索引,并将它们的值加在一起:
indexList = [1,2,3,4,5,6,7]
valueList = [6,7,2,0,1