A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

I'm stuck on problem set zero (you can start laughing). I can get raw_inputs to be stored in variables, to where I can just type in the variable that I have them into IDLE and be returned with the appropriate string. However, the problem I'm having is getting the code to run in a sequence. For instance, if I do FirstName = raw_input ('Enter Last Name') LastName = raw_input ('Enter First Name') It will query me for my last name and stop. I guess it's sequencing that I'm having issues with. Thanks for any potential help.

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do you enter your last name?

  2. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I noticed that I kinda flubbed up the variables, but no, it doesn't allow me to enter my last name.

  3. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    By which I mean first name. I'm confusing myself here.

  4. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    when this is executed FirstName = raw_input ('Enter Last Name') you should see Enter Last Name do you see it?

  5. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Yes. My issue is when I put my (fixed) LastName = raw_input ('Enter Last Name') command with my (also fixed) FirstName = raw_input ('Enter First Name'), it only queries me for my last name.

  6. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    so click on keyboard something and press enter

  7. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Let me copy/paste what's going on in my IDLE screen. >>> x = raw_input ('Enter Last Name') y = raw_input ('Enter First Name') Enter Last Name Test >>>

  8. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    X being LastName and Y being FirstName.

  9. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    My first issue is that it is not querying me for my first name after I enter my last name.

  10. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    well i have never used IDLE but your code is ok :D

  11. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm using Idle, saved your code and was prompted for first and last.

  12. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do you have to save code to a file.py? or you just type code in console?

  13. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    assuming the answer you put in for last name was "Test"

  14. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm typing the code in Notepad and copy/pasting it into IDLE, making sure that I don't miss a bit of code. It may very well be that I need to update Python. I'll be back in about 15 minutes after I update it.

  15. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    If you're using IDLE, in the Python Shell, go to file,and open a new window. use this to write your code and save it as a .py file you have to save in order to run the whole program.

  16. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    copy pasting may be not good

  17. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    try to enter each line into IDLE or from notepad you can save to file.py and run it

  18. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Bit too late now; I've already started uninstalling Python. But I swear... if it's saving it in a .py file that it was... Oh, those minor details. Will try it after updating Python to 3.

  19. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    don't update to 3!!!

  20. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yeah I'm using 2.7.1 , don't go to 3

  21. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    python 3 is somewhat different

  22. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    and im pretty sure mistake was copying/pasteing

  23. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    *won't go to 3 *will instead download python 2 again Alright.

  24. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    *sigh* It would be the fact that I'm not saving it in a .py file. Thanks for the help, guys!

  25. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    its not necessery to save it to file, but you cant copy/paste to IDLE if it asks for more than 1 input

  26. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    it's always the little things.

  27. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    try this print (raw_input("Enter the Last Name: ")+"\n"+raw_input("Enter the First Name: "))

  28. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    The problem could be you're pasting from notepad which uses the windows \r\n characters for line returns which isn't compatible with *nix based systems. Notepad is notorious for this. If you're using windows I would suggest Notepad++ which gives you the option of using unix style newline encoding so you won't run into this issue. It also offers line counts and code highlighting for easy reading.

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

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.