Hello, in this video we are going to look at, you know, deleting and destroying our objects. So we got car one, we got car two, it is a good idea and good practicing programming with Python programming in general, we no longer need an object, get rid of it, destroy it, so it no longer using memory. So to delete an object, it is really really simple. You just do yell call one. And that is to deal with self delete and the name of the instance object. So what I'm gonna do is print out the speed of car one and car two just to demonstrate this.
So it says look right here, car one is not defined because we deleted it but if I get rid of that, and I just do one that looks fine because cartoon is independent of call. So that was a So obviously, that's been deleted something else I want to cover as well. And that's a destructor. So like the constructor which is caught at the start of a class, the destructor is quality end of the class. And what our do method or dl commando is called destructor. So we can actually define the destructor because we have, you know, a default destructor.
But we can have a, our own one if we want to do some extra cleanup yet on this one, of course, do on its own school itself. And now inside of here, we can see this one print and say, object. Don't even like that. So now if we run it, and the object has been destroyed, obviously here, you could have Some extra clean or maybe if it's related to other parts of your application. But honestly, that's really in terms of the core philosophy, the core principle of delete destroying objects and the destructor in Python and programming in general. Thanks for watching, and I look forward to seeing you in the next video.