2. Scroll Text Quiz

2.1. Question 1

What is the default scrolling delay for the display.scroll() function if no delay parameter is specified?

Incorrect. 50ms is used for rapid scrolling.

Incorrect. 100ms is a custom short delay.

Correct. The default delay is 150ms when no delay is explicitly provided.

Incorrect. 300ms is used for slow scrolling.


2.2. Question 2

Which of the following data types can be passed directly into the display.scroll() function?

Correct. It can scroll text strings, whole numbers (integers), and decimals (floats).

Incorrect. The function is flexible and accepts integers and floats directly as well.

Incorrect. It can also scroll text messages wrapped in quotes.

Incorrect. Floating-point decimal numbers are also fully supported.


2.3. Question 3

What will happen when the following code block executes?

from microbit import *

while True:
    display.scroll('Hi', 50)

Incorrect. The number represents milliseconds, not seconds.

Incorrect. The while loop ensures it repeats indefinitely.

Correct. A smaller delay number makes the text scroll faster than the default 150ms.

Incorrect. It will still scroll horizontally.


2.4. Question 4

Which of the following lines of code demonstrates a valid way to scroll a message with a custom delay?

Correct. You can explicitly name the keyword argument ‘delay’.

Correct. You can pass the number directly as a positional second argument.

Incorrect. Positional arguments cannot follow keyword arguments in Python.

Incorrect. You cannot concatenate a string and an integer directly like this.


2.5. Question 5

Look at the following code block:

from microbit import *

while True:
    display.scroll('I like to watch', delay=60)
    display.scroll('AFL', delay=120)

Which text scrolls across the micro:bit LED display at a slower pace?

Incorrect. A delay of 60ms makes this text move faster.

Correct. A delay of 120ms is a longer pause between frames, making it scroll more slowly.

Incorrect. They use different delay values.

Incorrect. This is perfectly valid code.


2.6. Question 6

Why might you choose to use variables with display.scroll(), as shown in the code below?

from microbit import *

player = 'Locket'
goals = 1360
display.scroll(player)

Incorrect. Variables do not alter execution or hardware speed.

Correct. Keeping values at the top makes editing straightforward.

Incorrect. Raw strings work perfectly fine.

Incorrect. Infinite repetition is controlled by the while loop structure.


2.7. Question 7

What type of data value is stored in the variable goals_per_game in the following script?

goals_per_game = 4.84
display.scroll(goals_per_game)

Incorrect. Strings must be wrapped inside quotation marks.

Incorrect. Integers represent whole numbers without a decimal point.

Correct. A number containing a decimal point is represented as a floating-point number.

Incorrect. Booleans only represent True or False values.


2.8. Question 8

Which line of code correctly scrolls an integer value directly without formatting it as a text string?

Incorrect. The quotation marks turn this value into a string.

Correct. Passing a whole number without quotation marks passes it as an integer.

Incorrect. The inclusion of a decimal point makes this value a float.

Incorrect. This is invalid argument syntax for the scroll function.


2.9. Question 9

What is the core purpose of placing display.scroll() statements inside a while True: loop structure?

Incorrect. The loop does not handle hardware checking.

Incorrect. Code inside the loop keeps executing over and over.

Correct. The loop block keeps running as long as the condition evaluates to True.

Incorrect. Speed remains fixed to the delay parameter value.


2.10. Question 10

A student wants to scroll the text message “Born 2015” quickly using a 100ms delay. Which implementation is correct?

Correct. This uses a valid string and sets a quick 100ms delay.

Incorrect. The text characters will cause a syntax error because they lack quotes.

Incorrect. A 300ms delay makes the text scroll slowly, not quickly.

Incorrect. This only passes the integer, leaving out the text context “Born “.