-3

Extract one by one values from multiple lists and stored in to new LIST - Python

List1 = ('1', '2','3','4')

List2 = ('one', 'two','three','four')

List3 = ('1-1', '1-2','1-3','1-4')



output_list = ('1,one,1-1', '2,two,1-2','3,three,1-3','4,four,1-4')
Ganapathy
  • 13
  • 3
  • What did you tried so far? Please add some code snippets and read the guideline [How do I ask a good question? ](https://stackoverflow.com/help/how-to-ask) – QuagTeX Jul 28 '21 at 06:54

1 Answers1

0

You can use zip

List1 = ('1', '2','3','4')

List2 = ('one', 'two','three','four')

List3 = ('1-1', '1-2','1-3','1-4')

output_list = [f'{l1},{l2},{l3}' for l1, l2, l3 in zip(List1, List2, List3)]
eroot163pi
  • 1,791
  • 1
  • 11
  • 23