🔀

If / Else

(Con-di-tion-als)

What is it? 🤔

This is how computers make a Choice.

It's like a fork in the road. The computer asks a question (like "Is it raining?"). If the answer is YES, it goes one way. If NO, it goes the other way!

Example: What to Wear? 🌦️

Is it
Raining?
YES (If)
☂️

Take Umbrella

NO (Else)
😎

Wear Shades

💡 Fun Fact

You can chain these together! "If it's raining, take umbrella. Else If it's snowing, take a coat. Else, wear a t-shirt!"

🎮 Try It Yourself!

Switch the weather to see what the character wears.

WEATHER:
☀️
🌧️
😎

if (weather == "sunny") {
  wear("sunglasses");
} else {
  wear("raincoat");
}

🕵️ Secret Mission 🕵️

PASSPORT CODE: CHOICE