0Pricing
Coding for Kids · Lesson

The else Backup Plan

Do something else when it is false.

The else Backup Plan is a free Coding for Kids lesson on CoddyKit — 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, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

A Backup Plan 🅱️

Hi, smart coder! 🧠 Last time, if ran code when something was True. But what if it is False? We need a backup plan: else! 🦸

The else Word 🔀

else means "otherwise, do this instead". It runs when the if is False.

age = 4
if age > 5:
    print("Big kid!")
else:
    print("Little kid! 🍼")

One or the Other 🎚️

With if and else, exactly one part always runs. Never both, never none!

sunny = False
if sunny:
    print("Sunglasses! 😎")
else:
    print("Bring a coat! 🧥")

Same Indent Rule 📏

else lines up with if (no indent), and its code is pushed in with spaces, just like before!

hungry = True
if hungry:
    print("Eat a snack! 🍪")
else:
    print("All good! 😊")

Checking a Password 🔐

If the password is right, open the door. Otherwise, say no!

pw = "wrong"
if pw == "magic":
    print("Welcome! ✨")
else:
    print("Access denied! 🚫")

Pass or Try Again 📝

Use else to encourage trying again!

score = 30
if score > 50:
    print("You passed! 🎉")
else:
    print("Try again, you can do it! 💪")

Yes or No Answer 🙋

Ask a question and give two different replies with if and else!

ans = input("Do you like ice cream? (yes/no) ")
if ans == "yes":
    print("Me too! 🍦")
else:
    print("That is okay! 😊")

Big or Small Number 🔢

Check if a number is big. If not, the else tells us it is small!

n = 3
if n > 10:
    print("Big! 🐘")
else:
    print("Small! 🐜")

Day or Night 🌗

Let us pretend! If it is day, we play. Otherwise, we sleep.

day = True
if day:
    print("Play time! 🎈")
else:
    print("Sleepy time! 😴")

Hot or Cold 🌡️

Use else to handle the other case in a fun weather check!

temp = 30
if temp > 25:
    print("Hot! Get ice cream! 🍧")
else:
    print("Cool! Wear a sweater! 🧶")

You Got a Backup! 🎉

Great job! Try checking if you have 0 candies, with a happy else!

candies = 0
if candies > 0:
    print("Yum! 🍬")
else:
    print("Time to get more! 🛒")

Quick Check 🧠

Quiz time! 🎯 When does the else part run?

Recap Time! 🌟

Super work! 🎓 Today you learned:

  • else is the backup plan
  • It runs when the if is False
  • Exactly one part always runs
  • else lines up with if

You are a backup-plan boss! 😎

Frequently asked questions

Is the “The else Backup Plan” lesson free?

Yes — the full text of “The else Backup Plan” 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 “The else Backup Plan”?

Do something else when it is false. 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 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “The else Backup Plan” 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. Choosing with if
  2. The else Backup Plan
  3. Comparing Values
  4. More Options with elif
← Back to Coding for Kids