Advertisement
dennoh

7. countVowels

Jan 21st, 2021
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import re
  2.  
  3. vowels = '[aeiouAEIOU]'
  4. def countVowels(sentence):
  5.     found_vowels = re.findall(vowels, sentence)
  6.     return len(found_vowels)
  7.  
  8.  
  9. if __name__ == "__main__":
  10.     sentence = 'HEllo'
  11.     print(countVowels(sentence))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement