class
keyword.maruti
and audi
are objects created from the Car
class, and we call the drive
method on both objects to see the behavior.drive
is called using the object maruti
. The self
parameter in the method definition refers to the object itself, allowing us to access its attributes and call its methods.length
through the object maruti
.class
keyword, followed by the class name. Inside the class, define attributes and methods.object_name = ClassName()
.