[Tutor] syntax error with raw input

Steven D'Aprano steve at pearwood.info
Thu Nov 13 00:05:53 CET 2014

On Wed, Nov 12, 2014 at 04:38:51PM +0530, Vaibhav Banait wrote:
> Hi
> I am new to python. I learnt (!) using  raw_input a day back. Attempt to
> use has resulted in error. I am not able to spot a problem in syntax.

What makes you think it is a problem with syntax?

This is what happens when you have a syntax error:

py> 23 42 +
  File "<stdin>", line 1
    23 42 +
SyntaxError: invalid syntax

Look at the error you get instead: it doesn't say "SyntaxError", does 
it? It says "NameError".

NameError: name 'raw_input' is not defined

The reason is that in Python 3, "raw_input" has been renamed to just 


More information about the Tutor mailing list