路漫漫其修远兮,吾将上下而求索

导航

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博客 

posted on 2020-09-17 16:07  爱在西元间  阅读(10421)  评论(0编辑  收藏  举报