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

Hey, guys, I just started the course and I was able to create the commands that ask for first and last name but I can't figure out how to have the program reverse the full name. Any ideas?

OpenStudy (anonymous):

Assign the input to a variable (say, last_name and first_name), then print them out in reverse: print last_name, first_name

OpenStudy (anonymous):

how can I create two different raw_input's?

OpenStudy (anonymous):

foo = raw_input("blahblah") bar = raw_input("something") print bar, foo

OpenStudy (anonymous):

Ok, I really appreciate you taking your time to respond to my elementary questions...TH code that I have made is as follows: >>> print raw_input ('What is your first name?') + raw_input ('What is your last name?') What is your first name? Max What is your last name? Rosales Max Rosales >>> As you can see, the final line is my name in order, I want to reverse that. I tried assigning different values to the the input but it did not work.

OpenStudy (anonymous):

You have to use variables to store the values given by the user. Or you could reverse the print to be like: print raw_input("What is your last name?") + raw_input("What is your first name?"). More likely, they want you do use the assignment operator, and basic I/O. Did you check the Readings tab on 6.00 OCW's homepage? Probably, they indicate there something to understand this better :-)

OpenStudy (anonymous):

I got it function!

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!