I am stuck with problem set 0. How can I have this question print raw_input('enter last name? '), follow print raw_input('enter first name? ') and print the answer to both ?
I can show an example if that would help better, but instead of "print raw_input('enter last name?')". Assign the raw_input part to a variable for the first name part, then another for the last_name part. Then use the print and the + to combine them after the first two parts of the code. I did previously show the solution to it, but I think the replies here are to help learn. Not to show the exact solution.
So, going along with what whiteeraserboard said, you need a couple variables. These two variable are going to be made up of a string of characters entered in response to your raw_input line. Try something more like: firstname = str(raw_input("What is your first name?)) Get two variables assigned, one for each name, then print them back out.
kris40k, what does the str in you [previous response means?
str() turns what what is inside the parans in to a variable known as a string. A string can be many things, like a collection of letters. There is a link in the assignment to the Python Wiki that goes more into detail about variables and strings. The first part of the line states that this variable will be called firstname. So, what the line does is print on the screen,"What is your first name?", then takes the response input to that and turns it into a string called "firstname" that can later be printed out.
Join our real-time social learning platform and learn together with your friends!