[Tutor] raw_input

Rob Andrews rob@jam.rr.com
Wed, 20 Jun 2001 13:31:26 -0500


Your first line reads:

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

It should probably read:

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

This way you assign the user's raw input to the variable "name". And when
you ">>> print name" it should print the value assigned to name.

Woohoo I can help! 3;->

Rob
Useless Python
It's not just for breakfast anymore!
http://www.lowerstandard.com/python/index.html
----- Original Message -----
From: Brendhan Horne
To: tutor@python.org
Sent: Wednesday, June 20, 2001 1:20 PM
Subject: [Tutor] raw_input


>>> 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------