anonymous
  • anonymous
Im having a problem with the enter your name problem, my code looks like this print x = raw_input('Enter your First name') y = raw_input('Enter your Last name' ) print 'Your name is: ' x+y its not working =/
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
you need a comma in the last line after the apostrophe - it needs to be: print 'Your name is:', x+y
anonymous
  • anonymous
Would this program print x before you input the last name?
anonymous
  • anonymous
you don't need to put, print x = raw_input('Enter your First name'), cuz is a input command, that line should give you a syntax error, and try to make it look better like: x = raw_input('Enter your First name: ') y = raw_input('Enter your Last name: ' ) And in the print you should have put the "," instead of "+" cuz it will joing name and lastname, the "," gives you a space. print 'Your name is:', x, y

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Im doing a similar problem. (Birthday and Last Name). My code looks like this: >>>x=raw_input('Birthday') Birthday 01/01/2000 >>>y=raw_input('Last Name') Last Name Doe >>>print y,x Doe 01/01/2000 >>> When I try to run it I also get a syntax error.
anonymous
  • anonymous
ThealMaster, were the 2nd, 4th and 6th lines what u wrote or what the console replied?
anonymous
  • anonymous
What the console replied.
anonymous
  • anonymous
//This is my code, It looks kind of complicated. I didn't think about using "X and Y" // My answer looks like ('Doe', '3/14/85') // I want to know why it put parentheses and commas. I just want it to print out the last name and date of birth question = "Enter your date of birth:" print (question) answer = raw_input() question = "Enter your last name:" print (question) response = raw_input() print (response, answer)
anonymous
  • anonymous
It's because the code has print with parentheses. Try instead: print response, answer for your last line of code. I think this is a Python 2 vs. 3 thing. Here's a more thorough explanation that I found: http://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function
anonymous
  • anonymous
You don't need the first print statement. It could look like this user_birthday = raw_input('Enter your date of birth: ') It will prompt without the print command.
anonymous
  • anonymous
Thanks everyone... I did fix the problem!

Looking for something else?

Not the answer you are looking for? Search for more explanations.