from microbit import *
import random
while True:
if button_ a. is_ is_ pressed(): #按下A键
di splay. scroll(str ( ))
elif button_ b. is_ pressed(): #按下 B键
display. scroll (str (random. randint (6, 9)))
微信扫码预览、分享更方便