[Tutor] creating the equivalent of string.strip()

Alan Gauld alan.gauld at btinternet.com
Wed Oct 3 23:37:41 CEST 2007


"Ricardo Aráoz" <ricaraoz at gmail.com> wrote

> >It still won't work. Strings are immutable, you can't use del
> > to delete a character. Try it.
>
> It comes straight from Idle (still warm ;-) ).
> Notice s = list(s)

Shame and embarrassment! I read that code through both times and
never noticed the list conversion either time! I did wonder about the
join() but just dismissed it as irrelevant.

Grovelling apologies.

Alan G. 




More information about the Tutor mailing list