我如何将所有列表都包含在一个列表中,如下所示?

时间:2018-11-05 15:25:35

标签: python python-3.x list

a=['Bitcoin', 'Ethereum', 'XRP', 'Bitcoin Cash']
b=['$6,445.52', '$210.63', '$0.47', '$577.37']
c=['$2799740715', '$169677687', '$613043970', '$1585569914']

假设我有3个名为a,b,c.的列表 现在如何在python中像DE那样转换它们。

D =['Bitcoin','$6445.52','$2799740715'],
   ['Ethereum','$210.63','$1696377687'],
   ['XRP','$0.47','$613043970'],
   ['Bitcoin Cash','$577.37','$1585569914'],

E= ['Bitcoin',$6,445.52','$2799740715',
    'Ethereum','$210.63','$169677687',
     'XRP','$0.47','$613043970',
     'BitcoinCash','$577.37','$1585569914'
    ]

1 个答案:

答案 0 :(得分:0)

a=['Bitcoin', 'Ethereum', 'XRP', 'Bitcoin Cash']
b=['$6,445.52', '$210.63', '$0.47', '$577.37']
c=['$2799740715', '$169677687', '$613043970', '$1585569914']

D=[[i,j,k] for i,j,k in zip(a,b,c)]
E=[]
E+=D[0]+D[1]+D[2]+D[3]