【Python】字符串没有append方法

s='123'

s.append(str(9))pprint s

会报错:'str'  onject has no attribute 'append'

s=[ ]

s.append(str(9))

print s

['9']

原文地址:https://www.cnblogs.com/bashaowei/p/8628614.html