python TypeError can only concatenate tuple not str to tuple
生活随笔
收集整理的這篇文章主要介紹了
python TypeError can only concatenate tuple not str to tuple
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原因分析
- 這個錯誤出現是因為執行元組之間的合并
- 例子
- 注意事項,tuple2 的后面有一個逗號
- 執行結果如下
- 如果是列表則無需逗號
?
?
總結
以上是生活随笔為你收集整理的python TypeError can only concatenate tuple not str to tuple的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 算法题 如何找到数组中重复的数字
- 下一篇: 5000额度的信用卡有必要激活吗?两个问