You are viewing a single comment's thread. Return to all comments →
With the use of regex and list comprehension -->
text = sys.stdin.read().splitlines()[1].split(' ') vowels = 'aeiouy' score = 0 for word in text: if len(re.findall(rf"[{vowels}]", word, flags=re.I))%2 == 0: score += 2 continue score +=1 print(score)
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 →
With the use of regex and list comprehension -->