我有两个清单。我必须找到这些列表不同的索引。
case 1:
a = "node1 ip up ether 40 46 server low".split()
b = "node1 ip <down> ether <number(s)> server <status>".split()
output = [ [[2],[2]],
[[4,5],[4]],
[[7],[6]] ]
case 2:
a = ' label 0 12000 '.split()
b = ' label <number> <number>'.split()
output = [ [[1,2],[1,2]] ]
a,b 是输入列表,输出是结果列表。b 中与 a 不同的元素都包含在<>for 中。<blabla>
在案例 1 和案例 2 中,output[i][0]给出 的索引a并output[i][1]给出 的索引b。
- 在案例 1 中,
up在<down>位置 不同[2,2]。40, 46并<number(s)>在位置[4,5],[4]等方面有所不同。 - 在情况 2 中,
output[0][0] = [1,2]对应于0 12000并且output[0][1] =[1,2]对应于<number> <number>。