Python Forum

Full Version: Going thru tutorials..."NameError: name 'raw_input' is not defined"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm a total newbie, wrote machine code for years at GE, Digital Communications stuff. Off to try to learn Python.
In going thru the tutorials in one of the 'dummies' books, they have an example using raw_input(), and I get this error message
Error:
"NameError: name 'raw_input' is not defined"
now I presume i have not loaded some needed library. I downloaded and installed python 3.8, is there something else I must do?
Thanks, Henri Monnier
The tutorial you have is out of date, it is for python2.
input is used in python3 in place of raw_input.
(Jul-13-2020, 09:39 PM)Yoriz Wrote: [ -> ]The tutorial you have is out of date, it is for python2.
input is used in python3 in place of raw_input.

Yoriz,
Is there a list that helps a newbie like me to be aware of the changes betwixt version 2 and 3. That would be a GREAT help for those of us that are trying to learn.
Thanks..... Henri Monnier...
NOTE: Python 2 might be simpler in some respects, but now that more people are transferring to python 3,
you might need to use python 3 in order to better comprehend code.
I am also aware some changes in Try and Except statements.