RAW_INPUT

Jean-Paul Calderone exarkun at divmod.com
Mon Nov 7 12:25:11 EST 2005


On Mon, 07 Nov 2005 12:14:15 -0600, A D <gs2luv at line72.net> wrote:
>On Mon, 2005-11-07 at 07:57 -0800, john boy wrote:
>> I am having trouble with the following example used in a tutorial:
>>
>> print "Halt !"
>> s = raw_input ("Who Goes there? ")
>> print "You may pass,", s
>
>at this print line you need to do
>print "you may pass, %s" % s
>
>this will allow you to enter the string s into the output sentence

No, this is totally irrelevant.  The print in the original code will work just fine.

>
>>
>> I run this and get the following:
>> Halt!
>> Who Goes there?
>>
>> --thats it....if I hit enter again "You may pass,"
>> appears...
>>
>> In the example after running you should get:
>>
>> Halt!
>> Who Goes there? Josh
>> You may pass, Josh
>>
>> I'm assuming s=Josh...but that is not included in the statement at all
>> I don't know how you put "Josh" in or how you got it to finish running
>> w/o hitting enter after "Who goes there?"
>>
>> What am I doing wrong?

Did you try typing "Josh" and then enter?  Or any other name, for that matter...

Jean-Paul



More information about the Python-list mailing list