Re: [Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread John Fouhy
On 20/06/07, Norman Khine <[EMAIL PROTECTED]> wrote: > My question is how to get all the words in the string to start with > capital letter? Hmm, well the title() function is a new one to me :-) More generally, if we have raw = 'one two three', then I would have done it using raw.split(). i.e.

Re: [Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread Norman Khine
thanks, it is as easy as that ;) Adam A. Zajac wrote: > On Wed, 20 Jun 2007 12:32:53 +0200 > > Norman Khine <[EMAIL PROTECTED]> wrote: > >> My question is how to get all the words in the string to start with >> capital letter? > title() should do it > a = "hello world" a.title()

Re: [Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread Adam A. Zajac
On Wed, 20 Jun 2007 12:32:53 +0200 Norman Khine <[EMAIL PROTECTED]> wrote: > My question is how to get all the words in the string to start with > capital letter? title() should do it >>>a = "hello world" >>>a.title() >>>'Hello World' ___ Tutor maillis

[Tutor] AttributeError: 'list' object has no attribute 'capitalize'

2007-06-20 Thread Norman Khine
Hello, I would like to capitalize each word from an input form. The problem is that the input form can be added as: "HELLO world" "hello world" "HELLO WORLD" etc.. If I do this: >>> string = "HELLO world" >>> print string.capitalize() Hello world >>> only the first word gets capitalized. My