(Jun-24-2018, 05:05 PM)gontajones Wrote:Quote:while '_' in guess_word:
This will keep asking for new guess(letter) until there is no more '_' in the guess_word (the word is formed).
OK, sorry, my mistake - I missed the part that you change the original word (I was talking about
checkLetter
function) - but calling word.index( c )
is unneeded if you use enumerate
- and calling it twice is wasteful. You are building a mechanism that Python provides you under the hood.
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.