You are viewing a single comment's thread. Return to all comments →
what's wrong in this code ? It failed in some test cases . anyone help !
def minion_game(string): # your code goes here stuart_score = 0 kevin_score = 0 vowels = tuple('AEIOU') for i in range(len(string)): sub_string = "" for j in range(i,len(string)): #operation sub_string += string[j] if sub_string.startswith(vowels): kevin_score += 1 else: stuart_score += 1 if stuart_score > kevin_score: print(f"Stuart {stuart_score}") elif kevin_score > stuart_score : print(f"Kevin {kevin_score}") else: 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 →
what's wrong in this code ? It failed in some test cases . anyone help !