AttributeError: 'str' object has no attribute 'append'

前端 未结 5 694
夕颜
夕颜 2020-12-08 11:11
>>> myList[1]
\'from form\'
>>> myList[1].append(s)

Traceback (most recent call last):
  File \"\", line 1, in 
          


        
5条回答
  •  旧时难觅i
    2020-12-08 11:26

    If you want to append a value to myList, use myList.append(s).

    Strings are immutable -- you can't append to them.

提交回复
热议问题