Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

LuigiI

Hi everyone. Im working on the first problem but whenever I input any program into the IDLE it will read and only follow the first line of code. Like Ill have x = raw_input('What is your date of birth? ') y = raw_input('What is your last name? ') print (y + x) It will ask the date of birth. I type it and press enter and it starts a new program as if the other lines of code weren't there. This seems to apply to all the prgms Im writing. Any help with this appreciated :)

  • one year ago
  • one year ago

  • This Question is Open
  1. TuringTest
    Best Response
    You've already chosen the best response.
    Medals 1

    You should not be typing your code directly into the IDLE. Open a new window with CTRL+N, type your code there, then press F5 to run it.

    • one year ago
  2. michaelokt
    Best Response
    You've already chosen the best response.
    Medals 0

    ctrl+n to open a new window. save the new window with a py (.py at the end of the name of the file) extension. f5 and save to run and see the results in the idle window. you can have multiple windows open at the same time. it's neat.

    • one year ago
  3. shawnf
    Best Response
    You've already chosen the best response.
    Medals 0

    That's because the REPL process Reads the line when you hit enter, Evaluates it, and Prints. The next time around it doesn't print x because you did not tell it to. If you type x it will return what was entered into the prompt previously as you are in the same environment. But to answer your question, what you want (are trying) to do is pause Evaluate until you are done entering in your code, but when you hit enter, you are telling REPL to Evaluate. There is nothing in your code to tell REPL that there is a continuation, like, for example, if you were entering in a loop and the line ends in :

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.