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

I am trying to do the first problem of name and birthdate. I am having trouble with printing the responses. Is anyone working on this?

OpenStudy (stephencampbell):

Hey, Beth. What's the problem you're having?

OpenStudy (stephencampbell):

So this is what I did: I gave a name to the stuff that I wanted to get from the user - for date of birth, I just called it "DoB". I then said: DoB = raw_input("Please enter your date of birth >..."") What this does is prints a prompt using the words in quotations, and waits for the user to enter the info and hit return. It's printed it out using: print "You entered your date of birth as: ", DoB. Same idea for last name, amended to suit.

OpenStudy (stephencampbell):

oops; just noticed that I closed the raw_input string with two lots of quotation marks; that's just my fat thumbs; sorry! Just open and close with one lot of quotes :)

OpenStudy (e.mccormick):

the joy of minor synax errors. While a human can take in " or "" with about the same utility, a computer will scream at you over such a minor issue. =)

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!