From 5ee0233a6a23798efac549cdecdc35cf5a3b8af2 Mon Sep 17 00:00:00 2001 From: Divan De Bruin Date: Tue, 19 Nov 2024 11:12:43 -0500 Subject: [PATCH] Update Solution.py Corrected some spelling errors that I found. Also came across that you could not access s, so changed the variable to the one given in the parenthesis (string). --- Python/Strings/The Minion Game/Solution.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Python/Strings/The Minion Game/Solution.py b/Python/Strings/The Minion Game/Solution.py index dd46f3e..9f03e94 100644 --- a/Python/Strings/The Minion Game/Solution.py +++ b/Python/Strings/The Minion Game/Solution.py @@ -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) @@ -19,4 +19,4 @@ def minion_game(string): if __name__ == '__main__': s = input() - minion_game(s) \ No newline at end of file + minion_game(s)