英语里元音开头的词前面用 an,其他用 a。is_vowel(letter) 已经写好了。写 with_article(word),用它看第一个字母,返回 "an apple" 或 "a pear"。大写开头也算。
with_article("apple")→'an apple'with_article("pear")→'a pear'def is_vowel(letter):
return letter.lower() in "aeiou"
def with_article(word):
# 在这里写:第一个字母是元音,就返回 "an " + word
return "a " + word
写好了先点「运行」试试示例,没问题再点「提交」。