Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Python/Strings/The Minion Game/Solution.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
def minion_game(string):
vowels = 'AEIOU'
str_lenght = len(string)
str_length = len(string) # Corrected the spelling of length
kevin_score, stuart_score = 0, 0

for i in range(str_lenght):
if s[i] in vowels:
kevin_score += (str_lenght - i)
for i in range(str_length):
if string[i] in vowels: # s could not be accessed, used the variable in the parenthesis
kevin_score += (str_length - i)
else:
stuart_score += (str_lenght - i)
stuart_score += (str_length - i)

if kevin_score > stuart_score:
print("Kevin", kevin_score)
Expand All @@ -19,4 +19,4 @@ def minion_game(string):

if __name__ == '__main__':
s = input()
minion_game(s)
minion_game(s)