[EMAIL PROTECTED] wrote: >>>> rs='AUGCUAGACGUGGAGUAG' >>>> rs[12:15]='GAG' > Traceback (most recent call last): > File "<pyshell#119>", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment > > You can't assign to a section of a sliced string in > Python 2.3 and there doesn't seem to be mention of this > as a Python 2.4 feature (don't have time to actually try > 2.4 yet).
Strings are immutable in Python, which is why assignment to slices won't work. But why not use lists? rs = list('AUGC...') rs[12:15] = list('GAG') Reinhold -- http://mail.python.org/mailman/listinfo/python-list