The Minion Game

  • + 0 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")