[Tutor] raw_input

Deirdre Saoirse Moen deirdre@deirdre.net
Wed, 20 Jun 2001 11:37:54 -0700


At 2:20 PM -0400 6/20/01, 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.

You forgot to assign the result of the raw_input to a variable.

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

-- 
_Deirdre    Stash-o-Matic: http://weirdre.com    http://deirdre.net
"Cannot run out of time.... Is infinite time. You... are finite....
Zathrus... is finite. This... is wrong tool!" -- Zathrus