Object Oriented Programming using Python
Object-oriented programming Object-oriented programming is a paradigm of programming that models software code after real-life objects. Just like objects, you can have instances of objects and objects can have attributes. Let's get into it. Figure [1] - OOP Creating an object: class Car : pass car1 = Car () print ( car1 ) In the script above, we first defined a class Car, then instantiated Car class on variable 'car1' and we received the following output for our print statement. <__main__.Car object at 0x0124E490> This refers to the object stored at a particular memory location. We will see how to make this output more user friendly later on. Adding attributes to an object: All cars would have a make, model, and year of manufacture, so we can set those as attributes for our car1. In the script below, we have done just that. class Car : pass car1 = Car () car1 .make = 'Volkswagen' ca