Re: [Tutor] How to strip both single and double quotes

2005-10-05 Thread Dick Moores
Alan Gauld wrote at 04:38 10/5/2005: > > how to use strip just once to get rid of both kinds of quotes, single > and > > double. It seems necessary to do it something like this: > >JUst escape the quote character: > >s.strip('\'"') That did it! Thanks, Dick Moores _

Re: [Tutor] How to strip both single and double quotes

2005-10-05 Thread Mark Thomas
On 10/5/05, Dick Moores <[EMAIL PROTECTED]> wrote: > The text will contain "words" beginning or ending with non-alphabetic > characters. To strip them off I use string.strip([chars]). My question is > how to use strip just once to get rid of both kinds of quotes, single and > double. It seems neces

Re: [Tutor] How to strip both single and double quotes

2005-10-05 Thread Alan Gauld
> how to use strip just once to get rid of both kinds of quotes, single and > double. It seems necessary to do it something like this: JUst escape the quote character: s.strip('\'"') HTH, Alan G Author of the learn to program web tutor http://www.freenetpages.co.uk/hp/alan.gauld

[Tutor] How to strip both single and double quotes

2005-10-05 Thread Dick Moores
I'm writing a script that takes any text and outputs to a file a list of duples (k, word) where k is the number of occurrences of word in the text. The text will contain "words" beginning or ending with non-alphabetic characters. To strip them off I use string.strip([chars]). My question is how