placeholder image to represent content

micro:bit Python Functions

Quiz by Starter quizzes

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
8 questions
Show answers
  • Q1
    What is the syntax for printing text to the micro:bit display using Python?
    display.scroll()
    display.show()
    display.clear()
    display.text()
    30s
  • Q2
    What is the syntax for generating a random number on the micro:bit using Python?
    math.random()
    random.choice()
    random.int()
    random.randint()
    30s
  • Q3
    What does the button_a.is_pressed() function do?
    Disables the A button
    Simulates pressing button A
    Displays text on the screen
    Checks if button A is currently being pressed
    30s
  • Q4
    What is the syntax for setting a pin on the micro:bit to be an input?
    pinX.set_input()
    pinX.set_pull(pinX.PULL_DOWN)
    pinX.set_output()
    pinX.set_pull(pinX.PULL_UP)
    30s
  • Q5
    What is the syntax for creating a new variable in Python?
    var value = variable_name
    variable_name == value
    create.variable(value, variable_name)
    variable_name = value
    30s
  • Q6
    What is the syntax for playing a tone on the micro:bit using Python?
    music.tone(music.C4)
    music.play(music.NOTE_C4)
    sound.play(sound.C4)
    audio.play(audio.NOTE_C4)
    30s
  • Q7
    What is the syntax for creating a new function in Python?
    def function_name():
    func function_name():
    function = def function_name()
    create.function{name: function_name}
    30s
  • Q8
    What is the syntax for importing a module in Python?
    module_name.import()
    import module_name
    library module_name
    include module_name
    30s

Teachers give this quiz to your class