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 = "rain"
if weather == "rain":
print("Take an umbrella!")
else:
print("Wear sunglasses!")
Quiz time!
Now weather is sun. What does Bit say?
Yes! Sun is not rain, so the else path runs! Not quite. Have another go!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!