Preview

03 - Predicting outcomes challenge #2

 1. Analyse the following code. What do you predict will be the output?
x=5
if x is greater than 2:
  print("Greater")
else:
  print("Smaller")

  x

  Smaller

  Greater

  2

 2. The dog at the bottom of the stairs wants to get up to the very top, with the blue dog. Analyse the scratch script. Can you predict what will happen to the dog?
earlyyears_predicttheoutcome1_scratchpicture1.png

  The dog will get up to the very top and then go down two steps

  The dog will move up two steps and then stop

  The dog will not move

  The dog wil move up four steps and then stop

 3. This code instructs the dog to climb the stairs, right to the top. Can you fill in the red blanks?
earlyyears_predicttheoutcome1_scratchpicture2.png

  turn 50 degrees

  repeat 5

  stop

  move 50 steps

 4. Images 1 and 2 achieve the same thing. There is a ________ that can be seen in image 1. The same steps are being _______.
earlyyears_predicttheoutcome1_scratchpicture3.png

  idea / left out

  sequence and pattern / repeated

  big error / deleted

  loop / ignored

 5. Analyse the following code. Can you spot and point out the error?
a=8
b=9
total=a+b+c
print(total)

  The value of b is 9, which is too high

  The value of a cannot be 8

  The total should be a+b+c+d

  There is no value for 'c' and yet the total requires it to be there for the sum.