Final Score
Show how they did.
Final Score 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.
Show the Final Score! 📊🎉
The quiz is over! Now we tell the player how they did! 🏆
Let's make a fancy ending screen for our Math Quiz game! 🎮
score = 3
print('Quiz over! Your score is', score)Score Out of Total 📈
It's nice to show the score AND the total questions. Like 3 out of 5! 📈
We print both numbers so the player knows how they did.
score = 4
total = 5
print('You got', score, 'out of', total)A Message for a Great Score 🌟
If the player did great, let's celebrate! 🎉
Use if score == total: to check for a PERFECT score and cheer!
score = 5
total = 5
if score == total:
print('PERFECT! You got them all! 🌟')Different Messages for Different Scores 🎭
Let's give different messages! 🎭 Use if, elif (else-if), and else.
Great, okay, or keep trying, depending on the score!
score = 3
if score >= 4:
print('Amazing! 🌟')
elif score >= 2:
print('Good job! 👍')
else:
print('Keep practicing! 💪')What Is elif? 🤔
elif means 'else if'. It checks ANOTHER question if the first one was false! 🪜
The computer checks each one in order and runs the FIRST that's true.
score = 2
if score == 5:
print('Perfect!')
elif score == 2:
print('Halfway there!')
else:
print('Try again!')Give a Star Rating ⭐
Let's give stars! More correct answers = more stars! ⭐
We can repeat a star using '⭐' * score. Cool trick! 🤩
score = 4
print('Your rating:')
print('⭐' * score)Calculate a Percentage 💯
We can even show a percent score! 💯
(score / total) * 100 gives the percentage. 4 out of 5 is 80%!
score = 4
total = 5
percent = (score / total) * 100
print('You scored', percent, 'percent!')The Full Quiz Ending 🎮
Let's put it all together: a score, a message, and stars! 🎉
This is the grand finale of our quiz game!
score = 3
total = 4
print('You got', score, 'out of', total)
if score >= 3:
print('Great work! 🌟')
else:
print('Nice try! 💪')
print('⭐' * score)Play Again? 🔄
Good games let you play again! 🔄 We can ask the player if they want another round.
For now, let's just print a friendly invite to play again!
score = 2
print('Thanks for playing!')
print('Your score was', score)
print('Want to play again? Run it once more! 🔄')A Complete Mini Quiz! 🎲🏆
Here's a whole quiz from start to finish! Questions, checking, scoring, and a final message! 🤩
This is everything you learned in the course, working together!
import random
score = 0
for q in range(3):
a = random.randint(1, 9)
b = random.randint(1, 9)
correct = a + b
guess = correct
if guess == correct:
score += 1
print('Final score:', score, 'out of 3')
if score == 3:
print('Perfect! 🌟')
else:
print('Well done! 👍')Design Your Own Ending! 📊🎨
Your turn! Change the messages and the score numbers. 🤩
Make your own fun celebration for a high score! 🎉
score = 5
total = 5
print('GAME OVER')
print('Score:', score, '/', total)
if score == total:
print('CHAMPION! 🏆🎉')
else:
print('Good game! 😊')Quick Check ✅
Final brain teaser of the course! 🧠📊
Quiz Master! 🏆🎉
INCREDIBLE! You finished the Math Quiz Challenge! 🎮 You built a whole game! You learned:
- Show the score out of the total 📈
if,elif,elsefor different messages 🎭'⭐' * scoremakes star ratings ⭐- Percentages with
(score / total) * 100💯
You're a real game maker now! Keep coding! 🚀
Frequently asked questions
Is the “Final Score” lesson free?
Yes — the full text of “Final Score” 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 “Final Score”?
Show how they did. 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 “Final Score” 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.