在 Python3.2 我正在尝试做一个列表:
>> ls = 1, 2, 3
>> ls
(1, 2, 3)
>> ls.append(4)
使用最后一个命令,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'
为什么是这样?我该如何解决?谢谢你的时间