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