We will write a simple Python program that contains a class. To facilitate this, we will use Thonny, a Python IDE that comes pre-installed with Raspbian and has excellent debug and variable introspection functionalities. You will find that its ease of use makes it ideal for the development of our projects.
Writing a simple Python program
Creating the class
We will begin our program by creating a class. A class may be seen as a template for creating objects. A class contains methods and variables. To create a class in Python with Thonny, do the following:
- Load Thonny through Application Menu | Programming | Thonny. Select New from the top left and type the following code:
class CurrentWeather:
weather_data={'Toronto...