Re: A Python newbie ask a simple question

2007-07-13 Thread Steve Holden
Jeff McNeil wrote: > The raw_input built-in returns a string. The '[0]' subscript returns > the first character in the user supplied response as strings support > indexing. > > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more info

Re: A Python newbie ask a simple question

2007-07-13 Thread Wayne Brehaut
On Fri, 13 Jul 2007 14:51:52 -0400, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: >The raw_input built-in returns a string. The '[0]' subscript returns >the first character in the user supplied response as strings support >indexing. > >[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin >Type "hel

Re: A Python newbie ask a simple question

2007-07-13 Thread Christoph Haas
On Fri, Jul 13, 2007 at 06:35:16PM -, [EMAIL PROTECTED] wrote: > what does the statement "choice = raw_input(prompt)[0]" mean? I don't > know why there is a '[0]' in the statement. It calls the "raw_input" function with the argument of "prompt". That function returns a list and you are getting

Re: A Python newbie ask a simple question

2007-07-13 Thread Jeff McNeil
The raw_input built-in returns a string. The '[0]' subscript returns the first character in the user supplied response as strings support indexing. [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> mystr = "asdf" >>>