>> print q"/> >> print q"/> >> print q"/> >> print q"/>
Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 Online
OpenStudy (anonymous):

Where's my error?IDLE 1.2.4 >>> question1 = "What is your last name?" >>> print question1 What is your last name? >>> answer1 = raw_input() >>> question2 = "What is your first name?" >>> print question2 What is your first name? >>> answer2 = raw_input() >>> print answer2 >>> print answer1

OpenStudy (anonymous):

This is for ps0, I get a syntax error, but the only thing it highlights is the 5 in "python 2.5.4"

OpenStudy (anonymous):

Or is my whole approach wrong?

OpenStudy (anonymous):

If this is for ps0, try writing your code in a new .py file (File -> New) and running it (F5) in IDLE.

OpenStudy (anonymous):

I ran it through IDLE and it says I have a syntax error. When you get a syntax error, IDLE highlights where the error is, and in my case it highlights the "5" in "python 2.5.4" which is at the top of the screen when you open up python. I also know that I coded my program improperly I'm just trying to figure things out but i can't find my other errors until I get through this one.

OpenStudy (anonymous):

Can you past the error message as it is in the output for you?

OpenStudy (anonymous):

What I'm saying is that it looks like you're typing your code straight into the interpreter. If you write your code in an actual Python program file and then run it. I just ran it (I'm using 2.5.4) and I got no errors.

OpenStudy (anonymous):

OpenStudy (anonymous):

typo: paste instead of past in my post.

OpenStudy (anonymous):

the code should be like this: >>> question1=raw_input("What is your last name") What is your last name MyLastName >>> print question1 MyLastName >>>

OpenStudy (anonymous):

Pat I don't know if it were you who gave the medal, I'm just re-iterating in case, what others have said: I am almost certain that you are not in fact using IDLE but you are using Shell only. Open a New Window in Shell and use that to write your code.

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!
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!