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

Hi I really need help, I'm on the handout for Lecture 2 (i know should be easy) but I keep getting syntax errors for things that i really don't think I should and it's making it impossible to follow along. here's what it says (y is highlighted for error) >>> x = 15\ y = 5\ SyntaxError: invalid syntax I also seem to be getting syntax errors on semicolons even though I'm using 2.5 not 3.

OpenStudy (anonymous):

If you're going to use the \ sign to move to another line, the next line needs to be part of the old statement, not an entirely new statement. For example, something like this would work: >>> x = \ 15 It would assign 15 to x. You'd never actually want to break it up that way, but it works. What you actually want to do is this: >>> x = 15 >>> y = 5 Then, the values are assigned to the variables.

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!