从元组转换为列表时,我收到了一个错误

时间:2016-02-16 04:53:43

标签: python

Traceback (most recent call last):
  File "E:\MY WORKS\Python\list operations.py", line 23, in <module>
    new = list(tuple)
TypeError: 'str' object is not callable

1 个答案:

答案 0 :(得分:4)

您可能已使用字符串覆盖了内置=。在代码中查找类似的内容:

list

由于内置的​​list = "some_string" 功能不再可用,因此您尝试“呼叫”some_string时会收到该错误。