Raspberry Define class
In short, a class is used to describe a collection of objects with the same properties and methods. It defines the properties and methods common to all objects in the collection. In Python, classes are defined by using “class", and the class name ends with a colon. For example, in previous lessons, we introduced the Pin class in the machine library, which is the standard library of MicroPython. This class contains all the functions related to Pin. As shown below, we define a class of Servo.