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

I just started and am also using a mac. I'm more than a little confused about saving and running programs. I thought I'd completed skillset0 but I think I either made a syntax error or my brains exploded. Either way, this was my solution x= raw_input ('what is your last name? ') y=raw_input ('what is your date of birth?') print x + y what steps am I missing?

OpenStudy (anonymous):

Hey fuegopazzo, Your solution looks perfectly valid, what exactly is your problem / what kind of output are you seeing? I ran the following: x = raw_input ('what is your last name? ') y = raw_input ('what is your date of birth? ') print x + " " + y and this was my output: what is your last name? NixonInnes what is your date of birth? 16/10/1987 NixonInnes 16/10/1987

OpenStudy (anonymous):

Are you entering the code into the shell or the editor in IDLE?

OpenStudy (rsmith6559):

If you're code is in a file named foo.txt, in your home directory, the following command will execute it in Terminal: python foo.txt

OpenStudy (anonymous):

You should always name python files as py file types, not txt

OpenStudy (anonymous):

You need to save the scripts as foo.py then run them with "python foo.py" from terminal excluding the quotes. You might find this useful for your particular OS. Hope it helps. https://docs.python.org/2/using/mac.html#the-ide

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!