Play Again
Loop the game.
Play Again is a free Coding for Kids lesson on CoddyKit — lesson 4 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.
Play Again and Again! 🔁
Hi game master! 🎮 One round is fun, but playing MANY rounds is even better! 🔁
Today we learn to loop the whole game so players can keep going!
print('Want to play again? Let me show you how! 🔁')A Loop for Rounds 🔢
We can use a for loop to play a set number of rounds, like 3 games in a row! 🔢
for round in range(3):
print('Round', round + 1, 'starting! 🎮')The Whole Game in a Loop 🎯
Let's put a simple round inside the loop. Each loop = one full game! 🎯
import random
choices = ['rock', 'paper', 'scissors']
for round in range(2):
computer = random.choice(choices)
print('Round', round + 1, '- Computer chose', computer)Keeping Score 🔢
Let's count wins! We make a score box that starts at 0 and goes UP when the player wins. 🔢
score = 0
score = score + 1
print('Your score is now', score, '! 🏆')Score Across Rounds 📊
The score box stays OUTSIDE the loop so it remembers across rounds! Inside the loop, we add to it. 📊
score = 0
for round in range(3):
score = score + 1
print('After round', round + 1, 'score is', score)Ask: Play Again? ❓
Instead of a fixed number, we can ASK the player if they want to keep going! We use a while loop for this. ❓
again = 'yes'
while again == 'yes':
print('Playing a round! 🎮')
again = input('Play again? yes/no: ')The while Loop 🔄
A while loop keeps going AS LONG AS something is true! 🔄 "While the player says yes, keep playing!"
count = 0
while count < 3:
print('Loop number', count)
count = count + 1Stop When They Say No 🛑
When the player types something other than 'yes', the while loop STOPS! 🛑 Easy way to quit!
answer = 'yes'
while answer == 'yes':
print('Another round! 🎲')
answer = input('Again? (yes/no): ')
print('Thanks for playing! 👋')Full Replayable Game 🎮
Here is the complete Rock, Paper, Scissors that you can play over and over! 🎮 Keep playing until you type no!
import random
choices = ['rock', 'paper', 'scissors']
again = 'yes'
while again == 'yes':
player = input('Pick rock/paper/scissors: ')
computer = random.choice(choices)
print('You:', player, '| Me:', 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! 🤖')
again = input('Play again? (yes/no): ')
print('Goodbye! 👋')Show the Final Score 🏆
At the end, show how many times the player won! A nice way to wrap up the fun. 🏆
wins = 2
losses = 1
print('Final score! Wins:', wins, 'Losses:', losses, '🏆')You Built a Full Game! 🚀
WOW! 🚀 You made a complete, replayable Rock, Paper, Scissors game! You learned rules, random picks, deciding winners, and looping. You're a real game developer! 🎮
print('🎉 You built Rock, Paper, Scissors! 🎉')
print('You are a coding superstar! 🌟')Quick Check! 🧠
Test your replay skills! 🔁
Replay Champion! 🎉
Amazing! 🎉 Your game can play again!
- A
forloop plays a set number of rounds 🔢 - Keep the score box OUTSIDE the loop 📊
- A
whileloop repeats while something is true 🔄 - Type 'no' to stop the game 🛑
You completed Rock, Paper, Scissors! Super proud of you! 🏆
again = 'yes'
while again == 'yes':
print('Fun round! 🎮')
again = 'no'
print('Great game! 👋')Frequently asked questions
Is the “Play Again” lesson free?
Yes — the full text of “Play Again” 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 “Play Again”?
Loop the game. 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 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Play Again” 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.