nested_list = [[1, 2], [3, 4], [5, 6]] result = [] for sub in nested_list: for item in sub: result.append(item) print(result)
[1, 2, 3, 4, 5, 6]
[[1, 2], [3, 4], [5, 6]]
[1, 3, 5, 2, 4, 6]
程序运行报错