Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lviturei Group Title

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 =/

  • one year ago
  • one year ago

  • This Question is Open
  1. thepenguin Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    you need a comma in the last line after the apostrophe - it needs to be: print 'Your name is:', x+y

    • one year ago
  2. wacsam Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Would this program print x before you input the last name?

    • one year ago
  3. Gianko15 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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

    • one year ago
  4. TheallMaster Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • one year ago
  5. yak-coder Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ThealMaster, were the 2nd, 4th and 6th lines what u wrote or what the console replied?

    • one year ago
  6. TheallMaster Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    What the console replied.

    • one year ago
  7. KobeAsdrubal Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    //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)

    • one year ago
  8. hootenanny Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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

    • one year ago
  9. kb9agt Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • one year ago
  10. KobeAsdrubal Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks everyone... I did fix the problem!

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.