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

Ok, I'm probably missing something obvious here... but in problem set zero, I can't get a space when printing two raw_input() answers... I've tried multiple ways, but apparently not the right one...

OpenStudy (e.mccormick):

Not sure what you are trying to ask about. You can do code snippets betweeb ``` marks (one set above and one set below, on a line alone) and it does a code block: ``` IDLE 2.6.5 >>> a = raw_input("What to print?") What to print?This is a test. >>> print a This is a test. >>> ```

OpenStudy (e.mccormick):

I mean a code block hjere so we can see your code properly.

OpenStudy (anonymous):

Basically trying to do this: print("What is your first name") answer1 = raw_input() >> Hank print("what is your last name") answer2 = raw_input() >>Azaria print("Your name is " + answer1 + answer2) >> Your name is HankAzaria I can't get a space between the two variables when printing...

OpenStudy (e.mccormick):

+ specifically does not do spaces. If you want a space, use comma or + " " +

OpenStudy (anonymous):

Perfect! Thank you. I've been hung up on that for way too long. I tried using the comma, but it would always print the statement with apostrophes on both sides. I am completely new to this.

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!