MicroPython メモ 1

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

  • 数値は整数と浮動小数点数の 2 種類。
  • REPL のプロンプトで上向き矢印をクリックすると過去に入力したコマンドがさかのぼれる。
  • Lua と違って複合代入演算子 (+= など) が使える。
    f:id:ti-nspire:20171221120554p:plain
  • 文字列聯結演算子は +
    f:id:ti-nspire:20171221120218p:plain
  • 数値から文字列への型キャストには str() 函数を使う。
    f:id:ti-nspire:20171221121239p:plain