[Tutor] syntax error with raw input
Chris Warrick
kwpolska at gmail.com
Wed Nov 12 18:06:39 CET 2014
On Wed, Nov 12, 2014 at 12:08 PM, Vaibhav Banait
<careendoscopy at gmail.com> 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. I am using
> python 3.4.2. Kindly help
>
>
> a = raw_input("Write down your name: ")
>
> Output:
>
>
> Traceback (most recent call last):
> File "<pyshell#1>", line 1, in <module>
> a = raw_input("Write down your name: ")
> NameError: name 'raw_input' is not defined
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
In Python 3, raw_input() was renamed to input().
a = input("Write down your name: ")
Note that input() is also a thing in Python 2, but you shouldn’t use
that one for security reasons. Python 3’s is fine though.
--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16
More information about the Tutor
mailing list