python TypeError: 'str' object does not support item assignment”

时间:2016-02-26 22:01:54   收藏:0   阅读:1214

想替换string里的空格,遍历替换提示如题错误,查询得知string类型不可更改

1 import string
2 s = "2013/2/12"
3 b = s.replace(/,_)
4 
5 print b

 

原文:http://www.cnblogs.com/wswang/p/5221787.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!