您的位置:首页 > 移动开发 > Objective-C

解决错误: TypeError: 'str' object is not callable

2019-05-11 20:25 3363 查看
str=''
a = [1,2,3]
# for i in a :
#     str += i

# print(str)
b=1
# c=repr(b)
c =str(1)
print(c)

打印时

  File "E:/Ipython/字体解密 爬虫/test.py", line 9, in <module>
    c =str(1)
TypeError: 'str' object is not callable

Process finished with exit code 1

 

原因上面有定义的str变量,而str是python内置函数,调用时不能有其他的str变量

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: