Quiz: Object-Oriented Programming in Python
Test what you've learned about object oriented programming with this fun quiz!
We'll cover the following...
1
What will be the output of the following code?
class Animal:
def __init__(self, name):
self.name = name
def speak(self):
return "Some sound"
class Dog(Animal):
def speak(self):
return "Woof!"
dog = Dog("Buddy")
print(dog.speak())
A)
Some sound
B)
Woof!
C)
Buddy
D)
Error
Question 1 of 60 attempted
...
Access this course and 1400+ top-rated courses and projects.