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

Hi, just made my first assignment #0 and I would appreciate if someone could give me a feedback to see if is correct and also if there is another ways to write it better ? lastn = input("Enter last name :" ) print(lastn) firstn = input("Enter first name:") print (firstn) print (firstn +lastn)

OpenStudy (anonymous):

Ups !! I forgot to mention that I'm using Python 3.2.2

OpenStudy (anonymous):

looks good

OpenStudy (anonymous):

perfect though it will look better if you will leave space after colon

OpenStudy (anonymous):

my first and last name didn't have a space so i had print (firstn+" "+lastn) was there an easier way to add the space?

OpenStudy (anonymous):

oh yeah the space after the colon

OpenStudy (anonymous):

You may wanna use print (firstn+' '+lastn) for clarity

OpenStudy (anonymous):

or you could use print firstn,lastn here comma serves as a space

OpenStudy (anonymous):

ok, please excuse my complete lack of experience here but how do you type all this code without having each line run every time you hit enter? In other words, I'll get the first line lastn = raw_input ('enter your last name: ') and then I hit enter and I feel like that isn't what I should be doing. Any thoughts?

OpenStudy (anonymous):

You should write the code in a separate py file and then run it at once.

OpenStudy (anonymous):

this is the property of raw_input() to go to a next line of code you have to press Enter.So everything is allright.And I think you are typing in an interpreter, you just have press Ctrl+N simultaneously two keys and a new window where you can type your code will pop up.To run your code press F5.

OpenStudy (anonymous):

Thanks for bearing with a newcomer, I especially appreciate the keystroke tips.

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!