In Python, strings are immutable, so you cannot change their characters in place.
You can, however, do the following:
for i in str: srr += i
Reasons for this: this is a shortcut to:
for i in str: srr = srr + i
The above procedure creates a new line with each iteration and stores the link to this new line in srr .
NPE May 17 '12 at 7:19 2012-05-17 07:19
source share