[Tutor] Newbie question re: user interaction

Tesla Coil tescoil@irtc.net
Thu, 01 Feb 2001 18:38:02 -0600


On 1 Feb 2001, First Name Last Name wrote:
> 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$ "!"
>
> This is a staggeringly simple piece of code and I
> instinctively feel that a well-designed language
> like Python must have a simple and elegant way
> of replicating it

N = raw_input('what is your name? ')
print 'Hello,', N, '!'