Skip to content

Commit

Permalink
Count vowels done
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Goel committed Jul 11, 2013
1 parent 2a8b275 commit 9a41dc4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Text/count_vowels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Count Vowels - Enter a string and the program counts
the number of vowels in the text. For added complexity
have it report a sum of each vowel found.
"""

string = raw_input('Enter a string: ').lower()

vowels = ['a', 'e', 'i', 'o', 'u']
counts = dict(zip(vowels, [0, 0, 0, 0, 0]))

for vowel in counts:
for char in string:
if vowel == char:
counts[vowel] += 1

print counts

0 comments on commit 9a41dc4

Please sign in to comment.