# flatten a list flst = [[1,2,3], [8,9,12,17],[3,7]] flatten_list = sorted(sum(flst,[])) print(flatten_list) # [1, 2, 3, 3, 7, 8, 9, 12, 17]