forked from qiwsir/StarterLearningPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq58.py
More file actions
25 lines (21 loc) · 631 Bytes
/
q58.py
File metadata and controls
25 lines (21 loc) · 631 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
# coding=utf-8
def clean_word(word):
return word.strip().lower()
def get_vowels_in_word(word):
vowel_str = "aeiou"
vowels_in_word = ""
for char in word:
if char in vowel_str:
vowels_in_word += char
return vowels_in_word
if __name__ == "__main__":
data_file = open("dictionary.txt", "r")
print("Find words containing vowels 'aeiou' in that order:")
for word in data_file:
word = clean_word(word)
if len(word) <= 6:
continue
vowel_str = get_vowels_in_word(word)
if vowel_str == "aeiou":
print(word)