answer:
assert length_of_longest_word(["these", "are", "diminuitive", "words"]) == 11
assert length_of_longest_word(["short", "tiny", "haha", "antidisestablishmentarianism"]) == 28
我自己的作品停在这里:
max_length = 0 def length_of_longest_word(word_list): 对于(word_list)中的项目: abb = max_length + len(项目) 打印(abb)
return max(abb)
length_of_longest_word([“这些”,“是”,“身分”,“单词”])
(弹出拼写错误)
答案 0 :(得分:0)
def length_of_longest_word(word_list):
max_length = 0
for word in word_list:
max_length = max(max_length,len(word))
return max_length
print (length_of_longest_word(["these", "are", "diminuitive", "words"]))