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?
Assign the input to a variable (say, last_name and first_name), then print them out in reverse: print last_name, first_name
how can I create two different raw_input's?
foo = raw_input("blahblah") bar = raw_input("something") print bar, foo
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.
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 :-)
I got it function!
Join our real-time social learning platform and learn together with your friends!