class Word:
def __init__(self, word: str):
self.word = word
def vowel_count(self):
count = 0
for x in self.word:
if x in "aeiou":
count += 1
return count
def consonant_count(self):
count = 0
for x in self.word:
if x not in "aeiou":
count += 1
return count
if __name__ == "__main__":
w1 = Word("fantastic")
vowels = w1.vowel_count()
print(vowels)
consonants = w1.consonant_count()
print(consonants)
3
6