Tutorpip← About this lessonABCWith the answer keyDownload PDF
Coding · Ages 10+ · Set A
Bo the weather reporter
Scan to mark
on screen
A
Name
Date
Start Finish
Goal: 15 min
Score/ 11
Remember: If runs its lines only when the condition is true, and else runs when it is false. Two equals signs compare.

Read and answer

Read the story, then answer.

One program, two answersBo is the weather reporter at the Robot Club show, but a robot cannot see the weather. Ms. Ito says a computer chooses by asking a question that is only ever true or false, and a question like that is called a condition. Zara's plan is if weather == "rain": print Take an umbrella, then else: print Wear a hat. The lines pushed in under if belong to the if, and else has its own colon and its own pushed-in line. The weather box holds sun, so the condition is false. Python skips the umbrella line and runs else.
1
Zara changes line 1 to weather = "rain". What does Bo say?
☂️Take an umbrella🧢Wear a hat🤐Nothing
2
The box stars holds 4. Which condition is true?
stars > 4stars < 3stars == 4stars >= 5
3
Two equals signs ask whether two things are equal.
TrueFalse
4
One equals sign a value in a box.
skipsputsasks
5
One of these lines has a mix-up to fix. Which one?
if weather == "rain":if weather == "rain"else:
6
The lines under if run every time, whatever the condition says.
TrueFalse

Match, order and fix

7
Join each part to what it does.
  1. 1if
  2. 2else
  3. 3==
  4. 4=
  • Aputs a value in a box
  • Bruns its lines only when the condition is true
  • Casks whether two things are equal
  • Druns when the condition is false
8
The weather box holds sun. Put what Python does in order.
  • Python checks the condition
  • Python skips the lines under if
  • Python runs the lines under else
  • The condition is false
9
The box weather holds snow. Circle every condition that is true.
weather == "rain"weather == "snow"weather != "rain"weather != "snow"
10
Lines pushed in under an if line are said to be .
repeatedindenteddeleted
11
When the condition is false, Python skips the lines under if and runs the else lines.
TrueFalse
12
Write one more rule for Bo, such as what to say when it is snowy.
13
Draw a fork in a path, with one way for yes and one way for no.
Scan the code at the top to mark this sheet on screenTake a photo of your answers or type them. It is marked for you automatically, and your score is kept.