Tell us what’s happening:
I’m not able to pass the last check, because it asks the code to return “Draw”, but I’m not able to.
Your code so far
def points(arg):
if arg.islower():
return ord(arg.lower()) - 96
elif arg.isupper():
return (ord(arg.lower()) - 96) * 2
else:
return Exception
def battle(our_team, opponent):
my_points = 0
opponent_points = 0
for i in our_team.replace(" ", ""):
my_points += points(i)
for i in opponent.replace(" ", ""):
opponent_points += points(i)
if my_points == opponent_points:
return "Draw"
elif my_points > opponent_points:
return "We win"
elif my_points < opponent_points:
return "We lose"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Challenge Information:
Daily Coding Challenge - Battle of Words
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-12