python : TypeError: append() takes exactly one argument (2 given)
列表 添加方法 append()问题
list = []
list.append(1,2) #这里错误
#应该改为
list.append([1,2])
本文详细解析了Python中列表的append方法使用时常见的TypeError错误,通过一个实例展示了正确的参数传递方式,避免出现append() takes exactly one argument (2 given)的问题。
python : TypeError: append() takes exactly one argument (2 given)
列表 添加方法 append()问题
list = []
list.append(1,2) #这里错误
#应该改为
list.append([1,2])
1万+
1364

被折叠的 条评论
为什么被折叠?
TypeError: append takes exactly one argument 2 given&spm=1001.2101.3001.5002&articleId=123864617&d=1&t=3&u=b8542ae12e344a0f84fcc5d5774c3538)