Skip to content
The Lumenary

Practice · Grades 3–5

Repetition and decisions

Repetition and decisions

Warm-upHuman

The loop repeat 5 times: forward, turn right, clap is written out in full, one instruction after another. How many instructions is that?

Repetition and decisions

CoreHuman

Which program makes the turtle draw an equilateral triangle (three equal sides, ending where it started)?

Choose one

Repetition and decisions

CoreHuman

The program repeat 6 times: forward, turn right ☐ degrees draws a regular hexagon. What number goes in the box?

Repetition and decisions

CoreHuman

Start at 5. Repeat: add 4, until the number is bigger than 30. How many times is "add 4" done?

Repetition and decisions

CoreHuman

Which of these loops never stops?

Choose one

Repetition and decisions

CoreHuman

In FizzBuzz (FizzBuzz for multiples of 3 and 5; otherwise Fizz for multiples of 3; otherwise Buzz for multiples of 5; otherwise the number), which numbers from 1 to 20 are said as "Fizz"? Write them separated by commas, like {1, 2}.

Write elements separated by commas. Order and repeats don’t matter — just like in a set!

Repetition and decisions

CoreHuman

Add 476 + 358 with the column method. How many times do you carry 1?

Repetition and decisions

StretchHuman

When you add two numbers with the column method, why is the carry never 2?

Choose one

Repetition and decisions

StretchFormal

In Lean, run home p is where the robot ends up after following program p from home, and repeatBlock 4 [.forward, .turnRight] is the loop "repeat 4 times: forward, turn right". Which statement says that the square loop brings the robot home?

Choose one

Repetition and decisions

StretchComputational

Write a function fizzbuzz(n) that returns what a player says for the number n: "FizzBuzz" for multiples of 3 and 5, otherwise "Fizz" for multiples of 3, otherwise "Buzz" for multiples of 5, otherwise the number as text (for example "7"). In Python, n % 3 == 0 is the condition "n is a multiple of 3".

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.