Python学习笔记1 -- TypeError: 'str' object is not callable

时间:2021-01-07 03:14:18

Traceback (most recent call last):
File "myfirstpython.py", line 39, in <module>
print("params list:",str(sys.argv))
TypeError: 'str' object is not callable

str()是系统的方法,不能在用它的时候,同时自定义一个叫做str的变量,这样就会引起冲突。 检查一下自己的代码是不是也有类似的错误。