MicroPython メモ 2 / while ループ

参考: Programming the BBC micro:bit: Getting Started with MicroPython, p.31-32
 

from microbit import *

while True:
    display.scroll("hello")
    sleep(5000)
    display.scroll("bye")
    sleep(5000)

 
インデントはスペース 4 つが一般的。
display.scroll() の display のことを「オブジェクト」と呼ぶ。
display.scroll() の函数 scroll() は「(display オブジェクトに属している) メソッド」である。