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

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

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

 

posted @ 2016-02-26 21:02  wswang  阅读(6964)  评论(0编辑  收藏  举报