I am trying to figure out how to append multiple values to a list in Python. I've try for loop and append but i'm really stuck.
Here my list Array:
array_1 = [[('Manchester', '23', '80'),
('Manchester', '22', '79'),
('Manchester', '19', '76')],
[('Benfica', '26', '77'),
('Benfica', '22', '74'),
('Benfica', '17', '70')],
[('Dortmund', '24', '75'),
('Dortmund', '18', '74'),
('Dortmund', '16', '69')]
]
array_2 = [[('Manchester', '23', 'CM'),
('Manchester', '22', 'RM'),
('Manchester', '19', 'LB')],
[('Benfica', '26', 'CF'),
('Benfica', '22', 'CDM'),
('Benfica', '17', 'RB')],
[('Dortmund', '24', 'CM'),
('Dortmund', '18', 'AM'),
('Dortmund', '16', 'LM')]
]
I expected the outcome:
result = [[('Manchester', '23', '80', 'CM'),
('Manchester', '22', '79', 'RM'),
('Manchester', '19', '76', 'LB')],
[('Benfica', '26', '77', 'CF'),
('Benfica', '22', '74', 'CDM'),
('Benfica', '17', '70', 'RB')],
[('Dortmund', '24', '75', 'CM'),
('Dortmund', '18', '74', 'AM'),
('Dortmund', '16', '69', 'LM')]
]
i need to save the result into csv with header:
club | age | overall | position