We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- The Minion Game
- Discussions
The Minion Game
The Minion Game
Sort by
recency
|
1217 Discussions
|
Please Login in order to post a comment
vowel="AEIOU" st=0 ke=0 for i in range(len(s)): if s[i] not in vowel: st = st + (len(s)-i) else: ke = ke + (len(s)-i) if st>ke: print("Stuart",st) elif ke>st: print("Kevin",ke) else: print("Draw")
def minion_game(string): stuart = 0 kevin = 0 length=len(string) for letter in range(len(string)): if string[letter].lower() in 'aeiou': kevin += length - letter else: stuart += length - letter if kevin == stuart: print("Draw") elif kevin > stuart: print("Kevin", kevin) else: print("Stuart", stuart)
if name == 'main':