def isWordGuessed(secretWord, lettersGuessed):
    for char in secretWord:
        if char not in lettersGuessed:
            print('_',end=' ')
        else:
            print(char,end=' ')
print(isWordGuessed('apple', ['e', 'i', 'k', 'p', 'r', 's']))
The output is _pp_eNone
I want my output to be _pp_e while still using the print function to call the function.
What should I do?
 
    