1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| L1 = [ ['a','b', 'x',['n','f','gt'],['lo','k','l','m']] ,
['rt','f', 'y',['nd','f','gt'],['lo','k','l','m']] ]
L2 = [ ['x',['g','e','o','m','e','t','r','i','e'],'i','n','f','o','s1'] ,
['y',['g1','e','o','m','e','t','r','i','e22'],'i','n','f','o','s2'] ]
print 'L1 =\n','\n'.join(repr(y) for y in L1)
print
print '\nL2 =\n','\n'.join(repr(y) for y in L2)
print
deek2 = dict( (clk[0] , clk[1:]) for clk in L2 )
print 'deek2 =\n','\n'.join( repr(z)+' : '+repr(deek2[z]) for z in deek2)
print
for blk in L1:
for i,x in enumerate(blk):
if type(x)==type([]):
if blk[i-1] in deek2.keys():
blk.append(deek2[blk[i-1]])
break
print 'L1 apres complementation =\n','\n\n'.join(map(repr,L1)) |
Partager