You are viewing a single comment's thread. Return to all comments →
def minion_game(string): vowel_indexes = [i for i in range(len(string)) if string[i] in ['A', 'E', 'I', 'O', 'U']] cons_indices = [i for i in range(len(string)) if string[i] not in ['A', 'E', 'I', 'O', 'U']] vowel_score = sum([len(string)-i for i in vowel_indexes]) cons_score = sum([len(string)-i for i in cons_indices]) if cons_score > vowel_score: return print("Stuart", cons_score) elif cons_score < vowel_score: return print("Kevin", vowel_score) else: return print("Draw")
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 →