首先用spilt()将所有的单词分开,之后用for遍历将单词分配到字典中,统计数出元音字母出现的个数,最后将统计出的数进行比较计算,在for出最后最小的数字
print(least_vowel_words("the rhythm of life"))
['rhythm']
print(least_vowel_words("The quality of mercy is not strain'd ... mercy Percy."))
['mercy', 'percy']
a = "the rhythm of life".split(' ')
print(a[1])
for i in range(len(a)):
dic[i] = a[i]
print(dic)
a = "The quality of mercy is not strain'd ...mercy Percy.".split('...')
for i in range(len(a)):
dic[i] = a[i]
print(dic)
统计同理,取出dic的数,for一遍取出来判断元音就可,有用欢迎采纳