Object-oriented programming (OOP)
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). [wikipedia: https://en.wikipedia.org/wiki/Object-oriented_programming ]
In Python, when we define a function we can use that function multiple times just by calling it. The defined function is limited to a specific purpose and its varaibles only exist inside the function. But what if we want to do something more general that groups multiple functions and varaibles in one simple abstract concept. Here is when OOP comes in. There are two fundamentals concepts in OOP: classes and objects.
A class is the abstraction of an idea or real object. For example, let's think about the idea of circle. All circles have a radius, an area and a perimeter, which we can think of as the variables of the class or attributes. But we can also relate some procedures (code) to an arbitrary circle, for example the procedure of computing the area or the perimeter of the circle. These procedures are called methods. Then, we can define the class circle as follows:
Objects are the instances of the classes and we can think of them as the materialization of the classes. In the following code, we define two circles with different radius: