a simple question about string object

Brian Quinlan brian at sweetapp.com
Mon Mar 17 01:39:05 EST 2003


> i know the string object is immutable, so if i want to do 'item
> assignment', i should do:
> >>> new_s = s[0:1] + 'x' + s[2:]
> ( i think it's ugly)
> 
> Is there other ways to do this?
> should i define a function to do this? Is there any modules existing
can
> do this?

What problem are you trying to solve? 

Cheers,
Brian






More information about the Python-list mailing list