疑問在這段代碼的注釋裡
class Dog: kennel = 0 def __init__(self, breed): self.breed = breed Dog.kennel += 1 def __str__(self): return self.breed + " says: Woof!"class SheepDog(Dog): def __str__(self): return super().__str__() + " Don't run away, Little Lamb!"class LowlandDog(SheepDog): def __str__(self): return Dog.__str__(self) + " I don't like mountains!"#這裡用到Dog class的時候為什麼要加self,其他像super().__str__()這種就不用加?class GuardDog(Dog): def __str__(self): return super().__str__() + " Stay where you are, Mister Intruder!"rocky = LowlandDog("Collie")luna = GuardDog("Dobermann")print(rocky.kennel) #這裡的ouput是2,但我覺得是1,有點不太明白?print(rocky)