1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
from microbit import *
obj = {
"key": "val"
}
arr = [
'a',
'b'
]
def show_num(num):
if 1 + 1 == 2 and 2 + 2 == 4 or 3 + 3 == 6 \
and 3 - 3 == 0 and 'this is nonsense' == 'this is nonsense':
print('Hello')
text = """
This should survive
"""
i = Image()
i.fill(0)
if num & 0b00001000:
i.set_pixel(0, 2, 9)
if num & 0b00000100:
i.set_pixel(1, 2, 9)
if num & 0b00000010:
i.set_pixel(2, 2, 9)
if num & 0b00000001:
i.set_pixel(3, 2, 9)
display.show(i)
show_num(12)
|