[Tutor] Newbie question re: user interaction

David Porter jcm@bigskytel.com
Thu, 1 Feb 2001 19:14:32 -0700


* First Name Last Name <dis_gus_ted@my-deja.com>:
<...>
> Anyway, I understand enough of Python to look up the bits I don't remember
> in the manual, write simple functions, &c.  The part in my manual (O'Reilly
> 'Learning Python') about classes is complete gibberish to me, but I'm sure
> that will change in time.

I had similar troubles with classes too. The good thing is, that you don't
need to know them to use Python. I'm sure that eventually their benefits
will interest you in learning them, but you don't have to yet.

> Anyway, what I'm writing to ask about is, how do I do the equivalent of the
> following BASIC function in Python?
> 
> 10 INPUT "What is your name?" N$
> 20 PRINT "Hello, " N$ "!"

N = raw_input("What is your name?")
print "Hello, %s!" % N


David