On 14-09-10 17:44, Roelof Wobben wrote:
9 stripped_words = words.strip(".,!?'`\"- ();:")
Hello Joel,
Your solution works.
Im getting grazy. I tried it two days with strip and get a eof error message
and now no messages.
Look at the backslash! It doesn't strip the backslash in the string, but
it escapes the double quote following it.
I don't know how people can explain it any better.
You *do* see that this doesn't work, right?
>>> s = "foo"bar"
So you can't do this either:
>>> word.strip(",.!";:")
You need to escape the quote between the quotes:
>>> word.strip(".,!\";:")
Timo
Roelof
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor