Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Improving our object-oriented code to provide new features

Now that we have our counter working with the LEDs connected to the board, we want to add new features. We want to be able to easily transform a number between 1 and 9 into its representation in LEDs connected to the board.

The following lines show the code for the new NumberInLeds class. The code file for the sample is iot_python_chapter_03_05.py.