Python 列表索引拆分

Python 列表索引拆分,python,list,python-3.x,split,python-3.5,Python,List,Python 3.x,Split,Python 3.5,我试图返回一个句子长度您尝试的输入太小。最短的故事长度为6个单词,因此输入1-5与任何内容都不匹配。不过,代码在我看来很好,只是您的搜索输入。您尝试的输入太小了。最短的故事长度为6个单词,因此输入1-5与任何内容都不匹配。代码在我看来很好,只是你的搜索输入 stories = [['With bloody hands, I say good-bye.'], ['TIME MACHINE REACHES FUTURE!!! ... nobody there ...']

我试图返回一个句子长度
您尝试的输入太小。最短的故事长度为6个单词,因此输入1-5与任何内容都不匹配。不过,代码在我看来很好,只是您的搜索输入。

您尝试的输入太小了。最短的故事长度为6个单词,因此输入1-5与任何内容都不匹配。代码在我看来很好,只是你的搜索输入

stories = [['With bloody hands, I say good-bye.'],
['TIME MACHINE REACHES                FUTURE!!! ... nobody there ...'],
["Not In My Job Description: Make sure it's done by the end of the day Jones.\nBut, sir, it's not in my ....\nJust do it, and remember, no blood."]]

def len_sentence():
    search = int(input("Enter int"))
    for i in stories:
        len1 = (i[0][0:].split(' '))
        if len(len1) <= search:
            print(i)
len_sentence()