Re: question on "input"



On 12 Jul 2005 07:31:47 -0700, b83503104@xxxxxxxxx <b83503104@xxxxxxxxx> wrote:
> Hi,
>
> I want to accept the user's answer yes or no.
> If I do this:
>
> answer = input('y or n?')

Use raw_input instead:

>>> answer = raw_input("y or n?")
y or n?y
>>> answer
'y'

Check out the documentation of both functions at
http://docs.python.org/lib/built-in-funcs.html for more details.

<snip>

Peace
Bill Mill
.



Relevant Pages