Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, f pemberton
> wrote:
>
> > I've tried using replace but its not working for me.
> > xdata.replace('abcdef', 'highway')
> > xdata.replace('defgef', 'news')
> > xdata.replace('effwer', 'monitor')
>
> `replace()` does not work in place.  You have to bind the result to a name
> like::
>
>   xdata = xdata.replace('abcdef', 'highway')
>
> Ciao,
>       Marc 'BlackJack' Rintsch

lol, you probably will not believe me but I actually knew that already.
 I just forgot to add that part in my original post. When I try and
replace what happens is the first replace works fine but when I try and
do a second replace on a different part of the same string, the program
will print the string a second time(which I do not want). How can you
do 2 or more replaces in one line of code?

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

Reply via email to