← Quiz: Polymorphism: all 10 questions
Quiz: Polymorphism · Question 4 of 10
"Duck typing" in Python means:
"Duck typing" in Python means:
- A.Every class must inherit from Duck
- B.An object can be used if it has the needed methods, regardless of its class
- C.Types are checked at compile time
- D.Only built-in types can be used
Answer & explanation
Correct answer: An object can be used if it has the needed methods, regardless of its class
Behaviour matters, not the declared type.
Can you get the rest right without peeking?
Take the timed Quiz: Polymorphism quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →