Python TypeError: can only concatenate str (not "list") to str 报错问题的解决


Traceback (most recent call last):
  File "1.py", line 37, in <module>
    print("Test Over,Now is test ID:"+list)
TypeError: can only concatenate str (not "list") to str

 

解决方法:用str()将list列表转换为字符形式再输出!

  

 PS:OK! 

 

参考:

TypeError: can only concatenate str (not "list") to str(列表和字符串的报错解决方法)_Keegan的博客-CSDN博客 


免责声明!

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



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