Oct-09-2018, 06:53 PM
[:] just makes a copy of whatever it slices, it otherwise doesn't change how that thing is iterated over.
For your problem note that you only want to return True if none of the characters return False. So you put the return True after and outside the loop:
For your problem note that you only want to return True if none of the characters return False. So you put the return True after and outside the loop:
for char in secret_word[:]: if char not in letters_guessed: return False return True
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures