Coding for Kids · Lesson

Making Choices

Branch the story.

Lesson 2 of 413 steps

Making Choices is a free Coding for Kids lesson on CoddyKit. This is lesson 2 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.

Choose Your Path! 🌳

Ahoy again! 🏴‍☠️ The best adventures let YOU choose what happens next! 🌳

Today we learn to branch the story using choices and if! 🤔

print("Time to make choices! 🌳")

Offer Two Paths 🛤️

Give the player two paths to pick from! 🛤️

Then ask them which one they choose!

print("A fork in the road! 🛤️")
print("Left = cave 🕳️")
print("Right = river 🌊")
choice = input("Which way? (left/right) ")
print("You chose:", choice)

React with if 🧠

Now we make the game REACT to the choice with if! 🧠

Different choice = different story! ✨

choice = "left"
if choice == "left":
    print("You enter a spooky cave! 🕳️")
else:
    print("You swim across the river! 🌊")

More Than Two 🔀

Use elif to add even MORE paths! 🔀

elif means 'else, if this instead'! 🤓

choice = "climb"
if choice == "cave":
    print("Into the cave! 🕳️")
elif choice == "climb":
    print("You climb a tall tree! 🌳")
else:
    print("You wait around. 🤷")

Match the Real Choice 🎯

Let's connect the player's real input to the story! 🎯

door = input("Open the red or blue door? ")
if door == "red":
    print("A friendly monkey! 🐵")
else:
    print("A pile of gold! 🪙")

Watch the Spelling! 🔤

Computers are picky! "Left" and "left" are DIFFERENT to Python! 😮

Use .lower() to make everything lowercase and avoid mix-ups! 🪄

choice = "LEFT"
choice = choice.lower()
if choice == "left":
    print("Going left! 👈")

Choices Change Stats 📊

Choices can change the player's coins or health! 📊

Picking up gold adds coins! 🪙

coins = 0
choice = "grab gold"
if choice == "grab gold":
    coins = coins + 10
print("Coins now:", coins, "🪙")

A Risky Choice ⚠️

Some choices are RISKY! Touching a trap loses health! ⚠️

health = 100
choice = "touch trap"
if choice == "touch trap":
    health = health - 30
print("Health now:", health, "❤️")

Choices Inside Choices 🪆

A choice can lead to ANOTHER choice! Like nesting dolls! 🪆

path = "cave"
if path == "cave":
    print("Inside the cave you see a chest! 📦")
    print("Do you open it? Next lesson decides! 😏")

A Choice Function 🛠️

Wrap a choice in a function to reuse it! 🛠️

def ask(question):
    answer = input(question + " ")
    return answer.lower()

pick = ask("Go up or down?")
print("You picked:", pick)

Choice Master! 🏆

You can branch any story now! 🎉

  • if reacts to a choice 🧠
  • elif adds more paths 🔀
  • .lower() fixes spelling 🔤
  • Choices change coins and health 📊

Next: finding the treasure and WINNING! 💎

print("I can make choices! 🌳🥇")

Quick Check ✅

Let's test your choice-making skills! 🧠

Recap Time! 🎒

Great work, choice master! 🌟

  • if / elif / else branch the story 🌳
  • .lower() avoids spelling mix-ups 🔤
  • Choices change coins and health 📊
  • Choices can lead to more choices 🪆

Next: WINNING the treasure! 💎

print("Making Choices: complete! 🚀")
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 “Making Choices” lesson free?

Yes — the full text of “Making Choices” 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 “Making Choices”?

Branch the story. 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 2 of 4.

How long does the “Making Choices” 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. Planning the Adventure
  2. Making Choices
  3. Finding Treasure
  4. Game Over
← Back to Coding for Kids