Given a string and some indices, how do i change upper characters corresponding to some position(s) in the string to lower characters? I tried and failed.<br><br>>>> x = 'EPSPVRYDNLSR'<br>>>> z = [2, 6]<br>
>>> for i in z:<br> print x[i]<br><br> <br>S<br>Y<br>>>> for i in z:<br> print x[i].lower()<br><br> <br>s<br>y<br>>>> for i in z:<br> x[i] = x[i].lower()<br><br> <br>Traceback (most recent call last):<br>
File "<pyshell#14>", line 2, in <module><br> x[i] = x[i].lower()<br>TypeError: 'str' object does not support item assignment<br>