I want to modify a string in the following way :

 

for s in stks:

      s = s.strip()

      if ( s[-2:] == ‘GR’ ):

              s[-2:]= ‘GF’

 

so, if the last two characters are GR, I want to change

them to GF ( there will be other if statements also but I am

just putting this one here for simplicity ).

 

I think the code is fine but I vaguely remember

reading somewhere in the documentation that

python strings can’t be changed ( only elements of lists can be ) ?.

Is that true or is it okay to do the above.

.

                                   thanks

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to