Coding for Kids · Lesson

A Simple Yes/No Quiz

Check answers.

Lesson 4 of 413 steps

A Simple Yes/No Quiz is a free Coding for Kids lesson on CoddyKit. This is 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, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.

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! 🎉

Free to start

Learn Python with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

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. 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. The Coding for Kids course includes 4 lessons in total.

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, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.

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

  1. Yes and No Values
  2. Asking Questions
  3. And, Or, Not
  4. A Simple Yes/No Quiz
← Back to Coding for Kids