# Mastery test 1 - part 2

def compare(a, b):
    """
    >>> compare(3, 1)
    1
    >>> compare(2, 5)
    -1
    >>> compare(4, 4)
    0
    """
    if a > b:
        return 1
    elif a < b:
        return -1
    else:
        return 0


def count_vowels(sentence):
    """
    count the number of vowels (a,e,i,o,u) in a sentence
    
    >>> count_vowels("Hello, world!")
    3
    >>> count_vowels("baa baa do baa baa")
    9
    >>> count_vowels("zzz")
    0
    """
    sum = sentence.count('a') + sentence.count('e') + sentence.count('i')
    sum = sum + sentence.count('o') + sentence.count('u')
    return sum


def count_words(sentence):
    """
    >>> count_words("The quick brown fox jumps over the lazy dog")
    9
    >>> count_words("Hello")
    1
    >>> count_words("")
    0
    """
    return len(sentence.split())


def emphasise(sentence):
    """
    >>> emphasise("come here please")
    'COME HERE PLEASE!'
    >>> emphasise("leave me alone")
    'LEAVE ME ALONE!'
    """
    return sentence.upper() + '!'


if __name__ == '__main__':
    import doctest
    doctest.testmod(verbose=True)
