A Simple Yes/No Quiz
Check answers.
A Simple Yes/No Quiz 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.
A Yes/No Quiz 📝
Let us build a tiny quiz that checks if an answer is right! We use booleans and comparisons. ✅
The Right Answer 🔑
Save the correct answer in a variable.
answer = "yes"
print("Correct answer is:", answer)Check One Answer ✔️
Compare a guess to the right answer.
answer = "yes"
guess = "yes"
print(guess == answer)Right or Wrong 🚦
Use if to react to the answer.
answer = "yes"
guess = "yes"
if guess == answer:
print("Correct!")Add an Else 🙃
Use else to handle a wrong guess.
answer = "yes"
guess = "no"
if guess == answer:
print("Correct!")
else:
print("Try again!")A Real Question ❓
Store a question and its answer together.
question = "Is the sky blue?"
answer = "yes"
print(question)
print("Answer:", answer)Keep Score 🏆
Add 1 to score when correct!
score = 0
if "yes" == "yes":
score = score + 1
print("Score:", score)Two Questions 🔁
Check more than one answer.
score = 0
if "yes" == "yes":
score = score + 1
if "no" == "no":
score = score + 1
print("Score:", score)Ignore Big Letters 🔡
Use .lower() so "Yes" and "yes" both work!
guess = "YES"
print(guess.lower() == "yes")A Win Message 🎉
Show a message based on the score.
score = 2
if score >= 2:
print("You win!")Quiz Magic 💡
A quiz is just comparisons plus if/else plus a score counter. You can make any quiz you imagine! 🌟
Quick Check ✅
Final brain snack! 🍪
Quiz Master! 🌟
You built a yes/no quiz with comparisons, if/else, and a score. Now go make a quiz for your friends! 🎉
Frequently asked questions
Is the “A Simple Yes/No Quiz” lesson free?
Yes — the full text of “A Simple Yes/No Quiz” 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 “A Simple Yes/No Quiz”?
Check answers. 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 “A Simple Yes/No Quiz” 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
- Yes and No Values
- Asking Questions
- And, Or, Not
- A Simple Yes/No Quiz