Momentum logo
Team 12 Classroom

Exercise: working with sequences

Write a function that accepts one argument, a string, and counts the number of vowels (‘a’, ‘e’, ‘i’, ‘o’, ‘u’) in that string.

When you call the function with an all-lowercase string as an argument, your function should print the number of vowels in that string.

countVowels('bananarama')
# prints: Vowel count: 5

Where to write and run the code

You can do this a number of ways. Use whatever works for you. Here are some options:

Don’t forget that you have to define the function AND call the function with some argument to test it.