I'm trying to write a piece of code in Python 3 that takes a word and a set of letters and sees if the letters can form the given word. At line 4 I keep getting the TypeError stated in the question, and I don't know why because myLetters is a list, and it's not NoneType.
def formWord(myWord, myLetters):
myLetters = list(myLetters)
for wordLetters in myWord:
if wordLetters in myLetters:
myLetters = myLetters.remove(wordLetters)
continue
elif wordLetters not in myLetters:
return(False)
else:
return(True)