replace value of a specific position

Mel Wilson mwilson at the-wire.com
Thu Jul 10 16:57:02 EDT 2003


In article <jVhPa.8908$ru2.873667 at news20.bellglobal.com>,
"Sean Ross" <sross at connectmail.carleton.ca> wrote:
># or, without importing the string module:
>>>> t = '010010101001001110100101010111'
>>>> t = ''.join((t[:5],'2',t[6:]))
>>>> t
>'010012101001001110100101010111'


'2'.join ((t[:5], t[6:]))


        Sorry.          Mel.




More information about the Python-list mailing list