raw_input

jedi jedi at ccrypt.net
Wed Jun 20 14:31:29 EDT 2001


Should look more like this:

>>> name = raw_input("Enter your name:")
Enter your name: jedi
>>> print name
 jedi
>>>

you needed to assign the raw_input to a variable to print it out.  another
way you could have dones is:

>>> print raw_input("Enter your name:")
Enter your name:jedi
jedi
>>>

but I'm not sure if looks better.

On Wed, 20 Jun 2001, Brendhan Horne wrote:

> >>> raw_input ("Enter your name:")
> Enter your name:Brendhan
> 'Brendhan'
> >>> print name
> Traceback (innermost last):
>   File "<pyshell#7>", line 1, in ?
>     print name
> NameError: There is no variable named 'name'
>
> Okay What did I do wrong it should have printed my name after the print name
> command.
>
> --
> Thanks,
> Brendhan
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GE d- s: a C++ U(++) P(++) L+(++) E- W+ N+ o+ K- w+
> O+ M V? PS+ Y PGP(++) t++ 5++ X- R+++ tv++ b+++ DI++
> D G(++) e+(++) h-- r++ y++*
> ------END GEEK CODE BLOCK------
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list