I am v. stupid, please help

William Park parkw at better.net
Thu Jul 8 06:33:15 EDT 1999


On Wed, Jun 30, 1999 at 12:31:49AM +0100, Newbie wrote:
> From: "Newbie" <8499 at greenhead.ac.uk>
> 
> 
> I have just downloaded Python 1.5 and I have 
> had a brief look at the helpfiles and some 
> source code and my stupid question is this :
> How do you define a string and then use it 
> for input, e.g,
> 
> name = input('What is your name : ')
> 
> This works for integers but not for strings,
> 
> Help Me Please!!
> 
> --Posted from EarthWeb Discussions. http://discussions.earthweb.com
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list

Since 'eval' will simply execute your expression just as you would
type it interactively, try putting quotations around your input:

>>> input("==> ")
==> 123
123
>>> input("==> ")
==> 'sss'
'sss'
	
William Park





More information about the Python-list mailing list