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

I have no idea how to do problem set 0. x=raw_input('Enter your last name: ') y=raw_input('Enter your date of birth: ') print x,y How does the program go from the first question to the next?

OpenStudy (anonymous):

Well, if I understand your question, you're asking how the Python interpreter is going from one step to the next step. The raw_input command means that the interpreter will wait until you enter a string, and it will affect this string to a variable. Then, it will perform the second task. Then, it will print out the variables values. Interpreter works like that : it will read one line of code, will execute it, then will perform the next line. Am I answering your question?

OpenStudy (anonymous):

Yeah, I think. I wrote: x=raw_input('Enter your last name') y=raw_input('Enter your date of birth') print x print y print x,y in notepad and saved it and ran it from the command line and it worked. So it's like you said, the interpreter moves from one line of code to the next. I guess I'm having problems with IDLE. If I type x=raw_input('Enter name') in IDLE it prompts me to enter my name. I thought I was supposed to write this code in IDLE. How do I save the work from IDLE? Or run a program in it?

OpenStudy (anonymous):

Under Microsoft Windows, you can follow these (few and easy) steps (from "Follow these instructions to write and run a simple Python program using the IDLE editor") : http://www.annedawson.net/Python_Editor_IDLE.htm Under Linux, follow this howto : http://www.linuxcandy.com/2012/07/how-to-save-and-run-python-program-in-idle.html

OpenStudy (anonymous):

Thank you friend...run module.. very nice. Plus I deleted the two extra lines in my code. Slowly..

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!