Chapter 7


In this chapter

check An introduction to programming in the Python Editor

check ‘Hello, World!’: Your first Python program

check Programs for reading from button inputs, touch inputs, and the temperature, accelerometer, and compass sensors

check Fruit Catcher: A simple game to program and play on your BBC micro:bit

THE PYTHON PROGRAMMING language, named not for the snake but for the comedy troupe Monty Python, started life in 1989 as a hobby project of developer Guido van Rossum. Since its official release in1991, Python has grown in popularity thanks to its flexibility and a beginner-friendly format free of the need for hundreds of curly braces or semicolons you find in rival languages. Instead, Python makes heavy use of whitespace—space or tab indentations—to control where blocks of code begin and end.

Technically speaking, the BBC micro:bit is not programmed in Python itself but a variant of the language designed specifically for the BBC micro:bit and other microcontroller-based development and educational boards: MicroPython. MicroPython is a version of Python created by Damien George ...

Get The Official BBC Micro:bit User Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.