[学习笔记] Python 报错 can only concatenate str (not "int") to str

错误内容:
can only concatenate str (not "int") to str 
错误代码:
print("jianxieshi"+ c+ ".")

错误原因:

print 命令后引号内应该都是字符串 而不是变量

更正  

print("jianxieshi"+ str(c)+ ".")

 

posted @ 2019-07-14 16:11  ProgrammingNoob  阅读(12808)  评论(0编辑  收藏  举报