crwdns257118:0crwdne257118:0
crwdns257120:0crwdne257120:0
crwdns257122:0crwdne257122:0 crwdns257124:0crwdne257124:0
crwdns259438:0crwdne259438:0
crwdns274254:0crwdne274254:0
crwdns274256:0crwdne274256:0
crwdns259444:0crwdne259444:0
- crwdns259446:0crwdne259446:0
- crwdns259448:0crwdne259448:0
- crwdns259450:0crwdne259450:0 crwdns259452:0crwdne259452:0
- crwdns259454:0crwdne259454:0
crwdns259456:0crwdne259456:0
- crwdns259458:0crwdne259458:0
- crwdns259460:0crwdne259460:0
- crwdns259462:0crwdne259462:0
crwdns259464:0crwdne259464:0
1from microbit import *
2import random
3
4while True:
5 if button_a.is_pressed():
6 random_number = random.randint(1, 6)
7 if random_number == 1:
8 display.scroll('PE with Joe')
9 elif random_number == 2:
10 display.scroll('watch a movie')
11 elif random_number == 3:
12 display.scroll('play a board game')
13 elif random_number == 4:
14 display.scroll('tidy our rooms')
15 elif random_number == 5:
16 display.scroll('play a card game')
17 else:
18 display.scroll('learn a song')
crwdns259466:0crwdne259466:0
- crwdns259468:0crwdne259468:0
- crwdns259470:0crwdne259470:0
- crwdns259472:0crwdne259472:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.