The child class would have to inherit the parent self attribute to do that.
class Animal:
def __init__(self, name):
self.name = name
class Mammal:
def Presentation(inherit):
print(inherit.name + "is a mammal")
dog = Animal("Dog")
Animal.Mammal.Presentation(dog)
The child class would have to inherit the parent self attribute to do that.
class Animal:
def __init__(self, name):
self.name = name
class Mammal:
def Presentation(inherit):
print(inherit.name + "is a mammal")
dog = Animal("Dog")
Mammal.Presentation(dog)
The child class would have to inherit the parent self attribute to do that.
class Animal:
def __init__(self, name):
self.name = name
class Mammal:
def Presentation(inherit):
print(inherit.name + "is a mammal")
dog = Animal("Dog")
Animal.Mammal.Presentation(dog)
lang-py