Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 13 Online
OpenStudy (anonymous):

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

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

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

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

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

OpenStudy (anonymous):

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?

OpenStudy (anonymous):

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

OpenStudy (anonymous):

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.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Breathless: Spooky witch but cute
6 hours ago 3 Replies 0 Medals
Arriyanalol: help
6 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
9 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
8 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!