dennoh

7. countVowels

Jan 21st, 2021
604
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data