You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
659 B
40 lines
659 B
8 months ago
|
class Tier:
|
||
|
age = 0
|
||
|
|
||
|
def __init__(self, age):
|
||
|
self.age = age
|
||
|
|
||
|
|
||
|
class Katzenartig(Tier):
|
||
|
|
||
|
def schnurren(self):
|
||
|
print("Brrrr Brrrr Brrrr")
|
||
|
|
||
|
|
||
|
class Hauskatze(Katzenartig, Tier):
|
||
|
|
||
|
def __init__(self, age, name):
|
||
|
self.name = name
|
||
|
Tier.__init__(self, age)
|
||
|
|
||
|
def miau(self):
|
||
|
print("Miau Miau Miau")
|
||
|
|
||
|
|
||
|
class Grosskatze(Katzenartig, Tier):
|
||
|
|
||
|
def __init__(self, age):
|
||
|
Tier.__init__(self, age)
|
||
|
|
||
|
def roar(self):
|
||
|
print("Roar Roar Roar")
|
||
|
|
||
|
|
||
|
prinz = Hauskatze(11, "Prinz")
|
||
|
tiger = Grosskatze(5)
|
||
|
|
||
|
print(prinz.__class__.__mro__)
|
||
|
print(tiger.__class__.__mro__)
|
||
|
|
||
|
prinz.schnurren()
|
||
|
tiger.schnurren()
|