python输入一行字符串,调用wordsearch(),返回指定字符串中长度为5的单词?

改正错误
def wordsearch( ):
lst = txt.split()
find_word = []
for word in lst:
if len(word) ==5:
find_word += word+" "
return word
str1=input()
print(wordsearch(str1))

题主你好,

代码及测试截图如下:

希望可以帮到题主, 欢迎追问

温馨提示:答案为网友推荐,仅供参考
相似回答