You are viewing a single comment's thread. Return to all comments →
n = int(input()) user_input = input().split()
def score_words(ui): vowels = ['a','e','i','o','u','y'] count = 0 list1 = [] for i in ui: temp_alpha = list(i) for j in range(len(temp_alpha)): if temp_alpha[j] in vowels: count += 1 if count % 2 ==0: list1.append(2) count = 0 else: list1.append(1) count = 0 return sum(list1) print(score_words(user_input))
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()) user_input = input().split()
def score_words(ui): vowels = ['a','e','i','o','u','y'] count = 0 list1 = [] for i in ui: temp_alpha = list(i) for j in range(len(temp_alpha)): if temp_alpha[j] in vowels: count += 1 if count % 2 ==0: list1.append(2) count = 0 else: list1.append(1) count = 0 return sum(list1) print(score_words(user_input))