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

how do i make this section loop? http://dpaste.com/556287/ its line 123-139 that im trying to loop

OpenStudy (anonymous):

hmmm... how long do you want it to loop? or when do you want it to stop looping?

OpenStudy (anonymous):

until someone wins

OpenStudy (anonymous):

so something like while game_not_over: loop

OpenStudy (anonymous):

i think while and for are the only 'looping' statements. from the docs: "The while statement is used for repeated execution as long as an expression is true" "The for statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object:" http://docs.python.org/reference/compound_stmts.html#the-while-statement http://docs.python.org/reference/compound_stmts.html#the-for-statement

OpenStudy (anonymous):

my bad i wasn't thinking, but heres an updated version still has bugs in it, http://dpaste.com/556301/

OpenStudy (anonymous):

okay finished debugging, i had a if statement seeing if wordFragment was bigger than 3 characters long but i forgot to put len(wordFragment) so now its all good, thanks again bwCA

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