def long_words(n, str): word_len = [] txt = str.split(" ") for x in txt: if len(x) > n: word_len.append(x) return word_len print(long_words(3, "The quick brown fox jumps over the lazy dog"))
本文共 288 字,大约阅读时间需要 1 分钟。
def long_words(n, str): word_len = [] txt = str.split(" ") for x in txt: if len(x) > n: word_len.append(x) return word_len print(long_words(3, "The quick brown fox jumps over the lazy dog"))
转载于:https://www.cnblogs.com/sea-stream/p/9967890.html