I have a list below
a = [['1321.', 'Fuji', 'Kto', '776'], ['3123.', 'dake', 'Cu', '392'], ['123.', 'Hota', 'Cu', '310']]
And I have two lists of strings and want to append them into the list above by sequence to form a new list.
id = ['pid=1882','pid=1086','pid=180']
lgt = ['38.72347',
'38.23833',
'37.64986']
The result should become
new_list = [['1321.', 'Fuji', 'Kto', '776', 'pid=1882', '38.72347'],
['3123.', 'dake', 'Cu', '392', 'pid=1086', '38.23833'],
['123.', 'Hota', 'Cu', '310', 'pid=180', '37.64986']]
I have tried the zip method but the output is a tuple not a list.
new_list = list(zip(a, id, lgt))
new_list -> [[['1321.', 'Fuji', 'Kto', '776'], 'pid=1882', '38.72347'],
[['3123.', 'dake', 'Cu', '392'], 'pid=1086', '38.23833'],
[['123.', 'Hota', 'Cu', '310'], 'pid=180', '37.64986']]]
Thanks!