Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Solution.py #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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).
  • Loading branch information
7IronSnow7 authored Nov 19, 2024
commit 5ee0233a6a23798efac549cdecdc35cf5a3b8af2
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)