You are viewing a single comment's thread. Return to all comments →
from collections import Counter vowels = "AEIOU" def minion_game(txt): # your code goes here length = len(txt) score = Counter() for i, ch in enumerate(txt): points = length - i score[ch in vowels] += points # print(score) if (kevin := score[True]) > (stuart := score[False]): print(f"Kevin {kevin}") elif stuart > kevin: print(f"Stuart {stuart}") else: print("Draw") # Input (stdin) # BANANA # Expected Output # Stuart 12
Seems like cookies are disabled on this browser, please enable them to open this website
The Minion Game
You are viewing a single comment's thread. Return to all comments →