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的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 算法题 如何找到数组中重复的数字
- 下一篇: python实验练习-图书管理系统(使用