我有一个列表列表,比如
outlist = (['d1', 'd2', 'd3'], ['d4', 'd5', 'd6'])
我想将 ['d7', 'd8', 'd9'] 附加到上面的列表中
outlist.append(['d7', 'd8', 'd9']) 给我错误
Traceback (most recent call last):
File "<pyshell#42>", line 1, in <module>
outlist.append(['d7','d8','d9'])
AttributeError: 'tuple' object has no attribute 'append'
outlist.insert(['d7', 'd8', 'd9']) 也给了我一个错误
Traceback (most recent call last):
File "<pyshell#44>", line 1, in <module>
outlist.insert(['d7','d8','d9'])
AttributeError: 'tuple' object has no attribute 'insert'
需要帮助来解决这个问题。我还想将“outlist”写入 csv 文件。我怎么做?