原文:TypeError: 'range' object does not support item assignment處理方法

D: gt python vectorsum.py Traceback most recent call last : File vectorsum.py , line , in lt module gt c pythonsum size File vectorsum.py , line , in pythonsum a i i TypeError: range object does not ...

2019-04-03 08:31 0 1493 推薦指數:

查看詳情

TypeError: 'str' object does not support item assignment Python常見錯誤

1.string是一種不可變的數據類型 2.嘗試使用 range()創建整數列 有時你想要得到一個有序的整數列表,所以 range() 看上去是生成此列表的不錯方式。 需要記住 range() 返回的是 “range object”,而不是實際的 list 值 ...

Tue Oct 20 18:16:00 CST 2020 0 2526
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM