Daily Coding Challenge - Battle of Words

Tell us what’s happening:

Hello, I need help because I don’t know how to take into account each word in a for loop.

Your code so far

def battle(our_team, opponent):
    our_team = our_team.split()
    opponent = opponent.split()
    print(our_team)
    for lettre in our_team[0]:
        if lettre.isupper():
            print((ord(lettre.lower())-96)*2)
        else :
            print(ord(lettre.lower())-96)

    print(opponent)
    for lettre in opponent[0]:
        if lettre.isupper():
            print((ord(lettre.lower())-96)*2)
        else :
            print(ord(lettre.lower())-96)


    for mot1, mot2 in zip(our_team, opponent):
        print(mot1, "vs", mot2)

    return our_team, opponent

if __name__ == "__main__":
    battle("hello world", "hello word")
    battle("lorem ipsum", "kitty ipsum")
    battle("hello world", "world hello")
    battle("git checkout", "git switch")
    battle("Cheeseburger with fries", "Cheeseburger with Fries")
    battle("We must never surrender", "Our team must win")
    

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36

Challenge Information:

Daily Coding Challenge - Battle of Words
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-12

As I understand your code, you are printing value of every character in the first word of 2 lists which is not correct. You can use zip or a for loop and a helper function to get the current word’s values and compare them. So you should have a variable to keep track the win count of our_team after every comparison. Something like this:
for mot1, mot2 in zip(our_team, opponent):
my_value = get_word_value(mot1)
opp_value = get_word_value(mot2)
#compare
if mot1 > mot2:
increment win_count
elif …
else …

Hope this helps!