运行selection.autofilter代码时出现错误,无法解决问题。
我正在尝试通过电子表格F列中的名称“ JHILL2”自动过滤
def getHiddenWord():
file = open('dictionary.txt')
found = False
while found == False:
hiddenWord = input('Enter the hidden word')
for word in file.readlines():
if word.strip().lower() == hiddenWord.lower():
found = True
return hiddenWord.lower()
break
else:
continue
print('I don\'t have this word in my dictionary please try another word')
我试图只返回带有JHILL2的行