python拼接字符串 中有的是整數時需要用str()進行轉換才能進行拼接 TypeError: cannot concatenate 'str' and 'int' objects

f.write(strtime + '\t' + i + '\t' + titleYied + '\t' + urlyied + '\n')  # ‘\n’ 表示換行
TypeError: cannot concatenate 'str' and 'int' objects

解決: 

python拼接字符串 中有的是整數時需要用str()進行轉換才能進行拼接

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章