Puzzling input problem

Kevin Cazabon kevin_cazabon at hotmail.nospamplease!.com
Thu Mar 22 23:29:50 EST 2001


How about using this instead:

answer = raw_input("prompt string: ")




"Stephen R. Figgins" <fig at monitor.net> wrote in message
news:3AB9449C.A1D14738 at monitor.net...
| I ran into a puzzling problem combining print with raw_input().
| Normally I would pass the prompt string to raw_input, but instead I
| tried something like this:
|
|   print "prompt string: ",
|   answer = raw_input()
|   print answer
|
| When it prints answer, it is indented one space.  Why is raw_input()
| putting a space in there?  Is it a bug, a feature, an unintended side
| effect?  input() does this too.   I am currently using Active Python 2.0
| build 202.
|
| When I tried it with Jython 2.0, I didn't get the extra space.
|
|
| Stephen





More information about the Python-list mailing list