micro:bit Python Functions
Quiz by Starter quizzes
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
8 questions
Show answers
- Q1What is the syntax for printing text to the micro:bit display using Python?display.scroll()display.show()display.clear()display.text()30s
- Q2What is the syntax for generating a random number on the micro:bit using Python?math.random()random.choice()random.int()random.randint()30s
- Q3What does the button_a.is_pressed() function do?Disables the A buttonSimulates pressing button ADisplays text on the screenChecks if button A is currently being pressed30s
- Q4What 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
- Q5What is the syntax for creating a new variable in Python?var value = variable_namevariable_name == valuecreate.variable(value, variable_name)variable_name = value30s
- Q6What 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
- Q7What 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
- Q8What is the syntax for importing a module in Python?module_name.import()import module_namelibrary module_nameinclude module_name30s