question on "input"

Bill Mill bill.mill at gmail.com
Tue Jul 12 10:39:25 EDT 2005


On 12 Jul 2005 07:31:47 -0700, b83503104 at yahoo.com <b83503104 at yahoo.com> 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



More information about the Python-list mailing list