I am very new to this and have no programming background at all. I wrote this for assignment 0 .
print "What is your first name?"
print "what is your last name?"
Is it correct?
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Correct yes, but on the topic of writing a "small program" wouldn't it seem to be more fitting to also use the inserted strings for a returning print (like Hello first_name last_name.)?
If you need help on assigning a variable to the users input, take a look at this in IDLE's shell (pythons interpreter):
It will give you the info, how to correctly use the looked-up statement/command (in a bit abstract way... i had say).
Also a tip: Take your time watching some more lectures and first few recitations, before attempting to write something on your own. Makes it much easier... and you can still go back to assignments and quizes, if those are important to you.
I did watch 2 lectures and did some reading before writing that. I just wrote in easiest way I could think of.
Thanks for your reply!
Guttag has the right idea, but I feel it is best if you watch the lecture and then immediately try to write the program. They are geared towards one using the concepts that are taught in those lectures, not by using some method which, although may solve the problem that was asked, does not stress the point they were trying to make.
That being said, I think you should look at this: http://en.wikibooks.org/wiki/Python_Programming/Variables_and_Strings. You're assigning the values to your variables, but you need to do something with them now in order for the user to see them. Otherwise the user will input the data and then the program will stop.
Not the answer you are looking for? Search for more explanations.
What do you guys think of this
###First Name and Last Name
print"Hello,I am going to ask your first and last name"
print"Press Enter when ready"
first_question="what is your first name?"
second_question= "what is your last name?"
first_comment= "what a nice name"
second_comment= 'That must be a famous last name'
print"Thanks for info, Have a good day"