Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

Hi all...I am using python 3.2 ...there is an error when i type raw_input it says not defined...anyone have a clue??? thanks

OpenStudy (anonymous):

maybe your variable is not defined...

OpenStudy (anonymous):

>>> x = raw_input (" enter youe first name ") Traceback (most recent call last): File "<pyshell#29>", line 1, in <module> x = raw_input (" enter youe first name ") NameError: name 'raw_input' is not defined

OpenStudy (anonymous):

you must declare your variable first, maybe x as string

OpenStudy (anonymous):

>>> "x" = raw_input ("enter your first name " ) SyntaxError: can't assign to literal how to do that please.

OpenStudy (anonymous):

In python3.2 you can simply write x=input('Enter your first name\n') and if you need integers, y=int(input('Your age\n'))

OpenStudy (anonymous):

Yes it worked...thanks a lot

OpenStudy (anonymous):

If you are going to use 3.x instead of 2.x as the course instructions stipulated you should be prepared to figure out the differences between 3.x and 2.x ... 3.x is NOT backward compatible

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!