你忘了 叫 的
list()类型:
list_of_tuples = list()# ----------------^ You didn't do this.
您的异常(如评论中所述)表明您尝试调用
.append类型对象:
>>> list.append(())Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: descriptor 'append' requires a 'list' object but received a 'tuple'>>> list().append(())
[]在任何情况下,最好使用它来生成一个空列表:
list_of_tuples = []
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)