Editor settings

General settings

Save settings

Learn to program with Python

Count the vowels in a sentence #

Write a function that takes a sentence as input and returns the count of vowels present in the sentence. Vowels are the letters 'a', 'e', 'i', 'o', and 'u' (both uppercase and lowercase).


Tests #

  • count_vowels("Hello, World!") should return 3
  • count_vowels("Python is Awesome") should return 6
  • count_vowels("Quick brown fox jumps over the lazy dog") should return 10
  • count_vowels("THIS SENTENCE HAS VOWELS") should return 7
  • count_vowels("") should return 0
Output will be displayed here