1

This is what I came up with but is there a shorter way of doing this? Trying to make a list out of tuple pairs.

x = [[1, 2], [3, 4], [5, 6]]

list1, list2 = zip(*x) 

list1=list1+list2 

list1=list(list1) 

list1.sort() 

outcome is [1, 2, 3, 4, 5, 6]

Orif
  • 23
  • 1
  • 4
  • what are you trying to accomplish? the zip part would give you `1,3,5,2,4,6` but then you sort it, what are you trying to end up with? – Tadhg McDonald-Jensen Aug 31 '17 at 19:38
  • just was exercising the basic stuff. I already found this answer: flat_list = [item for sublist in x for item in sublist] – Orif Aug 31 '17 at 19:59

0 Answers0