Kodewick
Start learning →
Basic←→0 / 100

A or an

#074BasicFunctionsStrings4 min

In English, a word starting with a vowel takes an, and others take a. is_vowel(letter) is ready for you. Write with_article(word) to use it on the first letter and return "an apple" or "a pear". Capital first letters count too.

Examples
with_article("apple")→'an apple'
with_article("pear")→'a pear'
main.py
def is_vowel(letter):
    return letter.lower() in "aeiou"

def with_article(word):
    # your code here: a vowel first? return "an " + word

    return "a " + word
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.