Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created September 12, 2023 16:02
Show Gist options
  • Save codeperfectplus/323b58caacfdd229d9ebdd667d99755c to your computer and use it in GitHub Desktop.
Save codeperfectplus/323b58caacfdd229d9ebdd667d99755c to your computer and use it in GitHub Desktop.
def is_vowel(letter):
return letter in ['a', 'e', 'i', 'o', 'u', 'y']
def score_words(words):
score = 0
for word in words:
num_vowels = 0
for letter in word:
if is_vowel(letter):
num_vowels += 1
if num_vowels % 2 == 0:
score += 2
else:
score += 1
return score
n = int(input())
words = input().split()
print(score_words(words))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment