Quiz · Classes · lesson 8 of 11
Quiz — super()
What does the program print?
class Animal:
def __init__(self, name):
self.name, self.sound = name, "hum"
class Dog(Animal):
def __init__(self, name):
super().__init__(name)
self.sound = "woof"
print(Dog("Rex").name, Dog("Rex").sound)Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.