0Pricing
Coding for Kids · Lesson

Deciding the Winner

Compare choices.

Deciding the Winner is a free Coding for Kids lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Who Wins? 🏆

Hi judge! ⚖️ Now the exciting part: comparing the player's pick to the computer's pick to find the WINNER! 🏆

We'll use if statements to decide!

print('Let me see who wins! 🤔')

First, Check for a Tie 🤝

If both picked the SAME thing, it's a tie! We check this first with ==. 🤝

player = 'rock'
computer = 'rock'
if player == computer:
    print('It is a tie! 🤝')

When Does the Player Win? 😀

The player wins in three cases:

  • rock beats scissors ✊✌️
  • paper beats rock ✋✊
  • scissors beats paper ✌️✋

Let's check one!

player = 'rock'
computer = 'scissors'
if player == 'rock' and computer == 'scissors':
    print('You win! ✊ smashes ✌️')

The and Word 🔗

The word and means BOTH things must be true! 🔗 "Player is rock AND computer is scissors" — only then does this win count!

sunny = True
warm = True
if sunny and warm:
    print('Perfect beach day! 🏖️')

All Three Winning Cases 😀

Let's check all three ways the player can win, using or to join them! 😀

player = 'paper'
computer = 'rock'
if (player == 'rock' and computer == 'scissors') or (player == 'paper' and computer == 'rock') or (player == 'scissors' and computer == 'paper'):
    print('You WIN! 🎉')

Otherwise the Computer Wins 🤖

If it's not a tie and the player didn't win, then the computer wins! We use else to catch that. 🤖

player = 'rock'
computer = 'paper'
if player == computer:
    print('Tie! 🤝')
else:
    print('Computer wins this round! 🤖')

Put It All Together 🧩

Now the full winner-decider: tie first, then player win, then else computer win! 🧩

player = 'scissors'
computer = 'paper'
if player == computer:
    print('Tie! 🤝')
elif (player == 'rock' and computer == 'scissors') or (player == 'paper' and computer == 'rock') or (player == 'scissors' and computer == 'paper'):
    print('You win! 🎉')
else:
    print('Computer wins! 🤖')

With Real Picks 🎮

Let's use a real player choice and a random computer choice, then decide the winner! 🎮

import random
choices = ['rock', 'paper', 'scissors']
player = input('Your pick: ')
computer = random.choice(choices)
print('You:', player, '| Me:', computer)
if player == computer:
    print('Tie! 🤝')

Full Battle! ⚔️

Here's a full round with a real player pick, random computer, and the winner decided! ⚔️

import random
choices = ['rock', 'paper', 'scissors']
player = input('Pick rock/paper/scissors: ')
computer = random.choice(choices)
print('You:', player, '| Computer:', computer)
if player == computer:
    print('Tie! 🤝')
elif (player == 'rock' and computer == 'scissors') or (player == 'paper' and computer == 'rock') or (player == 'scissors' and computer == 'paper'):
    print('You win! 🎉')
else:
    print('Computer wins! 🤖')

Celebrate the Result 🎊

Whoever wins, make it fun with emojis and cheers! Even a tie is exciting! 🎊

result = 'win'
if result == 'win':
    print('🎉 You are the champion! 🏆')
else:
    print('Good game! Try again! 💪')

Winner Decider Pro! 🚀

You can now decide the winner of any round! 🚀 The secret is checking tie first, then player wins, then else. Brilliant!

player = 'rock'
computer = 'scissors'
if player == 'rock' and computer == 'scissors':
    print('Rock smashes scissors! You win! ✊')

Quick Check! 🧠

Test your winner-deciding skills! 🏆

Winner Champion! 🎉

Excellent! 🎉 You can decide who wins!

  • Check for a tie first with == 🤝
  • and means both parts must be true 🔗
  • or joins the three winning cases 😀
  • else means the computer wins 🤖

Next: playing again and again! 🔁

print('🏆 The winner has been decided! 🏆')

Frequently asked questions

Is the “Deciding the Winner” lesson free?

Yes — the full text of “Deciding the Winner” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO.

What will I learn in “Deciding the Winner”?

Compare choices. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Coding for Kids?

No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Deciding the Winner” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Coding for Kids lesson?

Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The Rules
  2. Computer Picks
  3. Deciding the Winner
  4. Play Again
← Back to Coding for Kids