When we first started programming, we had a limited number of commands that we could use. But we learned that we could build our own new commands (functions) by utilizing combinations of these other commands.
Imagine we could also do this with data types, building our own complex data type from simpler data types.
Object oriented programming (OOP from now on) is a programming paradigm that uses classes to create new data types that have attributes (variables) and behaviors (functions).
Note: In Python, functions called on an object are called methods.Â
In OOP, these variables belong to a particular object, and these methods act on a particular object.
For example, suppose you make the Human class, and an attribute of Human is age. If you made two Human objects you named bob and jean, then it would make no sense to access age on its own. You would have to access bob.age or jean.age. These age variables belong to a specific object and store that attribute of that object.
Suppose, in the Ball class, a Ball has the behavior bounce(). It makes no sense to call bounce() on its own. But you bounce a particular object. So if your Ball objects were ball1 and ball2, you could call ball1.bounce() or ball2.bounce() specifying which object we are acting on.