两个列表[1,5,7,9]和[2,2,6,8]合并为[1,2,2,5,6,7,8,9] a=[1,5,7,9] b=[2,2,6,8]
a = [1, 5, 7, 9]
b = [2, 2, 6, 8]
c = a + b
c.sort()
print(c)
[[1,2],[3,4],[5,6]]用一行代码展开该列表 得到[1,2,3,4,5,6]
test_list = [[1, 2], [3, 4], [5, 6]]
res = [item for s in test_list for item in s]
print(res)