We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n = int(input())
str1 = input()
str2 = str1.split(" ")
def func(a,b):
score = 0
for x in b:
count = 0
for char in x:
if char.lower() in 'aeiouy':
count += 1
if count%2==0:
score = score+2
else:
score = score + 1
return score
result = func(n,str2)
print(result)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Words Score
You are viewing a single comment's thread. Return to all comments →
n = int(input()) str1 = input() str2 = str1.split(" ")
def func(a,b): score = 0 for x in b: count = 0 for char in x: if char.lower() in 'aeiouy': count += 1 if count%2==0: score = score+2 else: score = score + 1 return score
result = func(n,str2) print(result)