60-sec Short If / Else 60 sec

If / Else: Pick a Path!

Should you take an umbrella today?

Real Python code

This is the code from the video. Read it out loud like a recipe, one line at a time!

weather.py
weather = "rain"
if weather == "rain":
    print("Take an umbrella!")
else:
    print("Wear sunglasses!")

Quiz time!

Now weather is sun. What does Bit say?

Try it yourself!

In Scratch, use an if then else block so your sprite says one thing when a key is pressed and something else when it isn't.

Bit is working on the next one: Loops: do it again!

Liked this quest?

Subscribe to see the next one first! Ask a grown-up before subscribing.

Keep exploring