按照你的要求编写的Python程序如下
def flat(nestedlist):
outcome = [nestedlist[i][j] for i in range(len(nestedlist)) for j in range(len(nestedlist[i]))]
return outcome
print(flat([[1,2,3],[4,5,6],[7,8,9]]))
源代码(注意源代码的缩进)
2018-01-12693