A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 3 years ago

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 :)

  • This Question is Open
  1. TuringTest
    • 3 years ago
    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.

  2. michaelokt
    • 3 years ago
    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.

  3. shawnf
    • 3 years ago
    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 :

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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...


  • 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.