Very Easy question concerning input
Orlando Vazquez
ovazquez at sprint.ca
Mon Jan 17 02:31:10 EST 2000
how about this? (i assume in the last `raw_input' you meant to put the
parantheses...)
>>> name = raw_input("What is your name? ")
What is your name? orlando
>>> name
'orlando'
>>> choice1 = raw_input("welcome, %s would you like to do something?" % (name,))
welcome, orlando would you like to do something?
TechSpood wrote:
>
> can someone tell me how to use a variable from a previous line and get a
> variable from the currentline using raw_input, for example
>
> I am trying to make a simple program that ask the user his name then says
> "welcome (name) would you like to do something"
>
> I tried this...but it doesn't work right...
>
> name=raw_input ("What is your name?")
> choice1=raw_input "welcome, %s, would you like to do something?" % name
>
> doing this displays a %s instead of the persons name, can you tell me how to
> fix this?
>
> thanks
--
Orlando Vazquez
More information about the Python-list
mailing list