From 6336d88f64e5b545b754de521ecfcee1954c3683 Mon Sep 17 00:00:00 2001 From: "Isurie K. Liyanage" <36602031+Isurie@users.noreply.github.com> Date: Wed, 27 Oct 2021 11:47:24 +0530 Subject: [PATCH] Create The Minion Game --- HackerRank/Python/Strings/The Minion Game | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 HackerRank/Python/Strings/The Minion Game diff --git a/HackerRank/Python/Strings/The Minion Game b/HackerRank/Python/Strings/The Minion Game new file mode 100644 index 00000000..fe62bbe7 --- /dev/null +++ b/HackerRank/Python/Strings/The Minion Game @@ -0,0 +1,18 @@ +def minion_game(string): + vowels = 'AEIOU' + str_lenght = len(string) + kevin_score, stuart_score = 0, 0 + + for i in range(str_lenght): + if s[i] in vowels: + kevin_score += (str_lenght - i) + else: + stuart_score += (str_lenght - i) + + if kevin_score > stuart_score: + print("Kevin", kevin_score) + elif kevin_score < stuart_score: + print("Stuart", stuart_score) + else: + print("Draw") +