面试题答案
一键面试nested_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
flattened_list = []
for sublist in nested_list:
for num in sublist:
flattened_list.append(num)
print(flattened_list)
nested_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
flattened_list = []
for sublist in nested_list:
for num in sublist:
flattened_list.append(num)
print(flattened_list)