Python 修改tuple元组提示:TypeError: ‘tuple‘ object does not support item assignment. 问题原因
生活随笔
收集整理的這篇文章主要介紹了
Python 修改tuple元组提示:TypeError: ‘tuple‘ object does not support item assignment. 问题原因
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
TypeError: 'tuple' object does not support item assignment.
翻譯:
類型錯誤:tuple 對象不支持項分配。
tuple 類型一旦初始化就不能修改,所以你要是修改它就會報錯。
例外:當 tuple 里包含 list 時,修改 list 里面的值是可以的。
喜歡的點個贊?吧!
總結
以上是生活随笔為你收集整理的Python 修改tuple元组提示:TypeError: ‘tuple‘ object does not support item assignment. 问题原因的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JavaScript 技术篇-js通过x
- 下一篇: PyQt5 技术篇-透明窗口设置方法,窗