Microbit Revision
Microbit Revision
Grade 6
Question 1
Q) Write a program to add two numbers (5 and 7) when Button A is
pressed and display the result. If Button B is pressed, subtract 4 from
12 and show the answer.
n1=4
n2=12
while True:
if button_a.is_pressed():
display.show(5+7)
if button_b.is_pressed():
display.show(n1-n2)
Question 2
Q) Write a program to measure temperature of the room. If the
temperature is 30 °C or more, display “WARMER” . Otherwise display
“COOLER”.