答案只有一句话:
def mean_length(l): return len(''.join(l))/len(l)
在这里,我们将连接列表中的所有字符串,并计算字符总数,最后将其除以 list ,因此,给了我们平均长度的单词。
list