[Tutor] RE: user interaction
AquaRock7@aol.com
AquaRock7@aol.com
Fri, 2 Feb 2001 22:34:01 EST
--part1_c9.ce89898.27acd629_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
The python equivalent of INPUT in BASIC is raw_input() and input(). Use it
:
inputstr = raw_input("What is your name? ") # this is for text entry
print inputstr
inputnum = input("What is your age?") # for numbers only - text raises error
print age
There ya go!
~D
--part1_c9.ce89898.27acd629_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
<HTML><FONT FACE=arial,helvetica><FONT SIZE=2>The python equivalent of INPUT in BASIC is raw_input() and input(). Use it
<BR>like this</BLOCKQUOTE>:</FONT><FONT COLOR="#000000" SIZE=3 FAMILY="SANSSERIF" FACE="Arial" LANG="0">
<BR>
<BR>
<BR>inputstr = raw_input("What is your name? ") # this is for text entry
<BR>print inputstr
<BR>
<BR>inputnum = input("What is your age?") # for numbers only - text raises error
<BR>print age
<BR>
<BR>There ya go!
<BR>
<BR>~D</FONT></HTML>
--part1_c9.ce89898.27acd629_boundary--