It's important for software developers to understand object-oriented
programming. In this course, Jim will teach you all about the complex concepts
that comes with object-orientated programming. We are going to do this by
developing a real Python application that is going to be very cool to write. And
throughout the way, we will understand everything that we need to know about
object orientation. If we call the tail Python that we want to create a datatype of
our own, it will allow us to write a code that we can reuse in the future easily. If
needed. Each instance could have attributes to describe related information about
it. So, let's go ahead and start creating our first class. Using the dot sign right after
the instance of a class, you can say that you want to give it an attribute, like a
name, that will be equal to phone, and item one, that price could be. 100. A good
candidate for a metal that we'd like to create now is actually calculate total price,
because as we understand, it could have been nice.
When you have isolated definitions with this keyword, then those are considered
to be called functions. But when you go ahead and create those functions inside
classes, those are called methods. Python passes the object itself as a first
argument. When you call a method from an instance. Python tries to pass one
argument and you are not received using any. That is why we are not allowed to
create methods that will never receive parameters. Opie is going to solve some
more problems that we have in terms of best practices in object-oriented
programming. IN. This episode, Opie tackles some of the most common problems
in object-oriented programming. Opie explains how to create a metal using a
method that can be used directly from an object. The second that we instantiate
an instance and there is a way that you can reach such a behavior. And that. By
creating a special method with a very unique name. The Collection of those
methods are used to be called Magic methods. And. We are going to learn a lot of
more magic methods that you have in Opie.