[学习笔记] 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)+ ".")

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM