Guest User

Untitled

a guest
Feb 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # Count Vowels
  2. # Enter a string and the program counts the number of vowels in the text.
  3. # For added complexity have it report a sum of each vowel found.
  4.  
  5. vowels = ['a', 'e', 'i', 'o', 'u']
  6. counter = [0, 0, 0, 0, 0]
  7.  
  8.  
  9. def count_vowels(string):
  10. for i in range(0, 5):
  11. counter[i] = string.count(vowels[i])
  12.  
  13. count_vowels(raw_input('String: '))
  14.  
  15. for i in range(0, 5):
  16. print vowels[i] + ": " + str(counter[i])
Add Comment
Please, Sign In to add comment