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
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.
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.
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
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?
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.
Join our real-time social learning platform and learn together with your friends!