例如,给定一个列表,
F=['MIKE', 'BALL', 'FISH', 'BAT', 'BEAR', 'CAT', 'AT', 'ALLY']
我将如何遍历所述列表以查找用户输入的具有一定长度的所有单词?我以为会..
number=input("How long would you like your word to be?")
possible_words=[]
for word in F:
if word(len)=number:
possible_words+=word