2017-10-17 7 views

Répondre

1

Essayez ci-dessous le code, il peut être utile à votre question

a=[9,2,3] 
b=[4,5,6] 
c=[1,1,1] 
l = list(map(lambda x,y,z:[x,y,z],a,b,c)) 

Vous obtiendrez la sortie comme ci-dessous
[[9, 4, 1], [2, 5, 1], [3, 6, 1]]

0
a = ['a1', 'a2', 'a3'] 

b = ['b1', 'b2', 'b3'] 

c = [1, 1, 1] 

print([list(l) for l in zip(a, b, c)]) 

# [['a1', 'b1', 1], ['a2', 'b2', 1], ['a3', 'b3', 1]]