0

I have three lists as stated. There are in different orders.

list1 = ['frame1', 'frame3', 'frame5', 'frame7']
list2 = ['.102', '.103', '.104', '.105']
list3 = ['.ext', '.ext', '.ext', '.ext']

How would one combine the three lists to make sense?

frame1, .102, .ext

When I do print(list1 + list2 + list3) of course the output will be:

frame1, frame3, frame5, frame7, .102, .103, .ext, .ext

I need my output to be like I said above, frame1, .102, .ext

Obstupesco
  • 55
  • 6

1 Answers1

0

Use zip to combine items from each list with the same index:

for x, y, z in zip(list1, list2, list3):
    print(x, y, z)

subject1 subject2 subject3
subject4 subject5 subject6
subject7 subject8 subject9
subject10 subject11 subject12
jpp
  • 159,742
  • 34
  • 281
  • 339