Skip to content

Commit d892b32

Browse files
author
nubianMONK
committed
Test for vowel_counter executed
1 parent e46b534 commit d892b32

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
def vowel_counter(str):
4+
5+
vowel_freqs = {}
6+
vowel_list = ['a', 'e', 'i', 'o', 'u']
7+
for word in str:
8+
str_list = str.split()
9+
for v in vowel_list:
10+
f = word.find(v)
11+
if f !=-1:
12+
if v in vowel_freqs:
13+
vowel_freqs[v] += 1
14+
else:
15+
vowel_freqs[v] = 1
16+
17+
for key,value in vowel_freqs.items():
18+
print key, value
19+
20+
21+
if __name__ == '__main__':
22+
str = raw_input("Please input a string: ")
23+
vowel_counter(str)
24+
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from vowel_counter import vowel_counter
2+
3+
def vowel_counter_test():
4+
str = raw_input("Please input a string: ")
5+
vowel_counter(str)
6+
7+
8+
if __name__ == '__main__':
9+
vowel_counter_test()

0 commit comments

Comments
 (0)