A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

Hello,I get through these the wrong way.I still do not understand the flow,syntax, etc. inherently(logic is fine)and I get the code from too much trial/error,suggestions,reference but do not understand it well enough even when it works out. http://codepad.org/nPGKNXR9 For GHOST function I tried to put sys.exit() under YOU LOSE and it did do anything. How do I get the game to restart or rather allow a new prompt to enter a new letter after the final 'else' loop? Final line 'play = was from someone else.I know it works but I do not understand it really.Thank you

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

    Sorry,ran out of room. PS5 Problem 6. Also,anywhere to work on this with someone else?Even a tutor, maybe.I could post so many questions. I know all the helpers are great and patient but this would be too much in this forum.

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

    is this what you had in mind?? http://codepad.org/2hEOlTqA

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

    I guess,I don't know much.I played with breaks before,did not work as I wanted(never do).Then I saw sys.exit.Why won't that work?And while I see the difference in your code,I do not understand why it is proper(I know it is).You go into that while loop to check input.So,when input is 1 letter it exits and goes to fragment.append?Thanks,sorry I am thick and slow.

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

    u are correct, it will keep asking for an input from the user till it gets the correct input - which is what i thought you were looking for. The tutorial in the documentation is a good reference http://docs.python.org/tutorial/index.html break will break out of the while loop or for loop that contains it. http://docs.python.org/reference/simple_stmts.html#the-break-statement sys.exit - "Exit from Python" http://docs.python.org/library/sys.html#sys.exit

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

    Have done all the reading,obviously,not soaked in.So if sys.exit were in place of break(or near that),should this not just exit the program?

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

    apparently it does http://dpaste.com/693530/

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

    Oh, I believe what is written when I read it and realize that when it fails it is ME.Thank you very much for your help.I am posting another question and it is a doozy.I really would rather do this with a peer or tutor simultaneously just to speed up everything.Plus would feel better about using others' time.

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