Skip to content

Commit 771ba98

Browse files
game added
1 parent a918f39 commit 771ba98

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Strings/The Minion Game/Solution.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def minion_game(string):
2+
vowels = 'AEIOU'
3+
str_lenght = len(string)
4+
kevin_score, stuart_score = 0, 0
5+
6+
for i in range(str_lenght):
7+
if s[i] in vowels:
8+
kevin_score += (str_lenght - i)
9+
else:
10+
stuart_score += (str_lenght - i)
11+
12+
if kevin_score > stuart_score:
13+
print("Kevin", kevin_score)
14+
elif kevin_score < stuart_score:
15+
print("Stuart", stuart_score)
16+
else:
17+
print("Draw")
18+
19+
20+
if __name__ == '__main__':
21+
s = input()
22+
minion_game(s)

0 commit comments

Comments
 (0)