Checkpoint 9.18.1.
A word is “vowelicious” if it contains four or more vowels. (If you never heard this word before, it’s because I made it up just now for this book.) For example, “mountain” and “bookbinder” are vowelicious; “trailer” and “reading” are not.
Write a program that takes a list of words and creates a new list containing only the vowelicious words. Your program should have two pure functions:
count_vowels
, which takes a string and returns the number of vowels it containskeep_vowelicious
, which takes a list of words and returns a new list containing only the words that have four or more vowels.
Hint.
The
keep_vowelicious
function should call the count_vowels
function.