[Tutor] reading strings

Richard Chamberlain richard_chamberlain@ntlworld.com
Sun, 10 Sep 2000 11:13:29 +0100


Hi Ankur,

Probably something like:

name=raw_input("What's your name? ");
print name

Richard
----- Original Message ----- 
From: <ankban4@indya.com>
To: <tutor@python.org>
Sent: Sunday, September 10, 2000 10:23 AM
Subject: [Tutor] reading strings


> Hi,
>     I am new to python (1 day).I have downloaded the python for 
> windows platform ver 1.5. Well i was tinkering around with it for 
> some time reading the tutorial that came along with it . Well , i 
> couldnt figure out 1 thing . How do i input  strings in python?
> In other words what is the python equivalent of the followig piece of 
> code :-
> print "Whats your name?";#perl code
> $name=<STDIN>;
> chomp($name);
> ****************************************
> print "Whats your name?"; /* C code */
> gets(name);/* name[10] defined earlier */
> 
> i  tried with input but with no success.
> Thanks for answering a newbie question.
> ankur
> 
> 
> Enter your default signature here
> Sent by Indya Messaging Service
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor