Python Strings

CHRIS unk at unk.ororr
Sun Aug 20 02:06:00 EDT 2000


How can you make a character-by-character copy of one string to a target
string, with out using a temporary list type variable? IE (with out
doing somethin like this):

fromstr = 'aslfdj';
target = [];
for i in range(len(fromstr)):
  #procssing done here
  target.append(fromstr[i]);

Also, what's the point of strings being immutable ?? If you want a
particular variable to be immutable, why not have some sort of constant
option? Like in C:

static const char str[] = "Constant immutable string";





More information about the Python-list mailing list