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

wow i feel horrible i cant get past set 0 problem 1 can someone help me plz?

OpenStudy (anonymous):

what are you having trouble with, can you post the code you currently have?

OpenStudy (anonymous):

.... and did you read the Hint in the problemset?

OpenStudy (anonymous):

this is what i have done far and i did something really wrong

OpenStudy (anonymous):

>>> print raw_input('Enter first name') Enter first name >>> print raw_input('Enter last name') Enter last name

OpenStudy (anonymous):

the computer doesnt know where to store the values that you are asking for

OpenStudy (anonymous):

also raw_input kind of acts like a print... try doing the code without print and see what happens

OpenStudy (anonymous):

First of all, the problem asks you to write a program which asks for the LAST name first and the FIRST name second, then spits the name back at you in the right order. You need your program to rearrange the user input so that the first name comes before the last name. Once you figure out how to do this you'll realize what you are missing. BTW, you don't need to put print before raw_input.

OpenStudy (anonymous):

the last paragraph of the Hint in the problemset has a link to the variable/string entry of the Python wikibook - that might help you

OpenStudy (anonymous):

link to the variable/string entry in Python wikibook and link to the solutions to the example problems at the bottom. I found that most helpful in solving that problem

OpenStudy (anonymous):

my output scrolled off the screen i used the code below trythis = raw_input('hit the enter key') it waits for a carriage return

OpenStudy (carlsmith):

You need to assign the value returned by the raw_input function to some variable, as in a = raw_input() You only pass a string of text to raw_input if you wish to create a prompt. When raw_input is called, it prints the prompt and then waits for a response from the user, that is whatever the user types before pressing enter ~ potentially nothing, returning an empty string. If we do stuff = raw_input('write here ->') the computer will print the prompt write here -> then wait for someone to enter something after the prompt. If you typed spam and eggs then pressed enter, the raw_input function returns the string 'spam and eggs' which in the above case is assigned to the variable named stuff. If you now do print stuff The computer will print the value of the variable stuff, in our case spam and eggs Hope that helps.

OpenStudy (carlsmith):

@Koala2 Are you still stuck with that?

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!
Latest Questions
danielfootball123: What are good stocks to invest
53 minutes ago 1 Reply 0 Medals
Burro: 5(5x+7)+3(x+3)
11 hours ago 13 Replies 2 Medals
danielfootball123: Poem about a certain month of my life Driving to a destination wasting all creati
2 minutes ago 4 Replies 2 Medals
XShawtyX: More art
1 hour ago 28 Replies 4 Medals
amirthegoat: I need help learning triangalar prisims
23 hours ago 3 Replies 0 Medals
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!