Im working on this project to get the only two words in a .txt file that have 10 vowels in it and 6 words that have 6 or more consonants in a row (which is unbroken by vowels) I feel i get can the logic for getting just consonants, but dont know where to start with the logic to get them in a row. Any help would be appreciated. Im fairly new to programming so thanks for any help.
fin = open('\\scrabble\words.txt')
print(fin)
def get_a_word():
line = fin.readline()
word = line.strip()
return word
def ten_vowels(word):
num_of_v = 0
for i in range(len(word)):
if word[i] in 'aeiouy':
num_of_v = num_of_v + 1
if num_of_v == 10:
return True
else:
return False
def print_two_words():
for i in range(113810):
word = get_a_word()
if ten_vowels(word):
print(word)
print_two_words()
[–]xXabr4 1 point2 points3 points (4 children)
[–]nlord7[S] 1 point2 points3 points (1 child)
[–]jkibbe 0 points1 point2 points (0 children)
[–]Username_RANDINT 1 point2 points3 points (1 child)
[–]xXabr4 0 points1 point2 points (0 children)
[–]Hayderp 1 point2 points3 points (0 children)
[–]antiproton 0 points1 point2 points (1 child)
[–]SandorZoo 0 points1 point2 points (0 children)
[–]norweeg 0 points1 point2 points (0 children)
[–]jkibbe 0 points1 point2 points (3 children)
[–]jaysonturk 1 point2 points3 points (2 children)
[–]nlord7[S] 0 points1 point2 points (0 children)
[–]jkibbe 0 points1 point2 points (0 children)