def getGuessedWord(secretWord, lettersGuessed):
secretWord_copy = ""
for i in secretWord:
print(i)
secretWord_copy = secretWord.replace(i," _ ")
print(secretWord_copy)
secretWord = 'apple'
I'm trying to replace every character of secretWord
with "-" but the above code only replaces the last one:
appl _
What's wrong?
The result should be _ _ _ _ _ _