Question on for loop
Bryan Devaney
bryan.devaney at gmail.com
Mon Mar 4 09:34:13 EST 2013
> if character not in lettersGuessed:
>
> return True
>
> return False
assuming a function is being used to pass each letter of the letters guessed inside a loop itself that only continues checking if true is returned, then that could work.
It is however more work than is needed.
If you made secretword a list,you could just
set(secretword)&set(lettersguessed)
and check the result is equal to secretword.
More information about the Python-list
mailing list