🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Polymorphism: all 10 questions

Quiz: Polymorphism · Question 4 of 10

"Duck typing" in Python means:

"Duck typing" in Python means:

  1. A.Every class must inherit from Duck
  2. B.An object can be used if it has the needed methods, regardless of its class
  3. C.Types are checked at compile time
  4. 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 →